A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro using a cell reference



 
 
Thread Tools Display Modes
  #1  
Old March 24th, 2010, 12:51 PM posted to microsoft.public.excel.misc
Jason Falzon[_2_]
external usenet poster
 
Posts: 7
Default Macro using a cell reference

I have an aplication called DPlot that can take commands from inside excel
using macros.

I managed to interact already with it using the following: -

Sub DownElevation()
'
' DownElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,-1)]"
DDETerminate Channel

End Sub
Sub UpElevation()
'
' UpElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,1)]"
DDETerminate Channel

End Sub
Sub LeftAzimuth()
'
' LeftAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(-1,)]"
DDETerminate Channel

End Sub
Sub RightAzimuth()
'
' RightAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(1,)]"
DDETerminate Channel

End Sub

I created a button for each macro and that works fine. But the problem is
that to acheive the disired result I have to click a lot of times on each
button. I know that I can replace the 1 and -1 with higher numbers but then
that will be too course.

I was wondering if and how I could replace the 1 and -1 numbers with cell
contents, which cells contents are controlled via a scroll bar inside excel.

I know how to use the scroll bars, but I cannot find the correct way to
declare the cells inside the macro and subsequently how to use them/their
value.
  #2  
Old March 24th, 2010, 12:57 PM posted to microsoft.public.excel.misc
Luke M[_4_]
external usenet poster
 
Posts: 451
Default Macro using a cell reference

Can you do something like:

DDEExecute Channel, "[ContourViewChange(," & Range("A2").Value & ")]"

--
Best Regards,

Luke M
"Jason Falzon" wrote in message
...
I have an aplication called DPlot that can take commands from inside excel
using macros.

I managed to interact already with it using the following: -

Sub DownElevation()
'
' DownElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,-1)]"
DDETerminate Channel

End Sub
Sub UpElevation()
'
' UpElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,1)]"
DDETerminate Channel

End Sub
Sub LeftAzimuth()
'
' LeftAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(-1,)]"
DDETerminate Channel

End Sub
Sub RightAzimuth()
'
' RightAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(1,)]"
DDETerminate Channel

End Sub

I created a button for each macro and that works fine. But the problem is
that to acheive the disired result I have to click a lot of times on each
button. I know that I can replace the 1 and -1 with higher numbers but
then
that will be too course.

I was wondering if and how I could replace the 1 and -1 numbers with cell
contents, which cells contents are controlled via a scroll bar inside
excel.

I know how to use the scroll bars, but I cannot find the correct way to
declare the cells inside the macro and subsequently how to use them/their
value.



  #3  
Old March 24th, 2010, 01:50 PM posted to microsoft.public.excel.misc
Jason Falzon[_2_]
external usenet poster
 
Posts: 7
Default Macro using a cell reference

Yes this works as it takes the value of my cell, but the problem is that I'd
like the macro to continuasly refresh so as it takes the new value
immediately, as the application calls for the cell value to change frequently
through a scroll bar.

"Luke M" wrote:

Can you do something like:

DDEExecute Channel, "[ContourViewChange(," & Range("A2").Value & ")]"

--
Best Regards,

Luke M
"Jason Falzon" wrote in message
...
I have an aplication called DPlot that can take commands from inside excel
using macros.

I managed to interact already with it using the following: -

Sub DownElevation()
'
' DownElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,-1)]"
DDETerminate Channel

End Sub
Sub UpElevation()
'
' UpElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,1)]"
DDETerminate Channel

End Sub
Sub LeftAzimuth()
'
' LeftAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(-1,)]"
DDETerminate Channel

End Sub
Sub RightAzimuth()
'
' RightAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(1,)]"
DDETerminate Channel

End Sub

I created a button for each macro and that works fine. But the problem is
that to acheive the disired result I have to click a lot of times on each
button. I know that I can replace the 1 and -1 with higher numbers but
then
that will be too course.

I was wondering if and how I could replace the 1 and -1 numbers with cell
contents, which cells contents are controlled via a scroll bar inside
excel.

I know how to use the scroll bars, but I cannot find the correct way to
declare the cells inside the macro and subsequently how to use them/their
value.



.

  #4  
Old March 24th, 2010, 04:16 PM posted to microsoft.public.excel.misc
Reg
external usenet poster
 
Posts: 71
Default Macro using a cell reference

Wrap this around it and put it in ThisWorkbook

Private Sub Workbook_SheetChange()

End Sub

"Jason Falzon" wrote:

Yes this works as it takes the value of my cell, but the problem is that I'd
like the macro to continuasly refresh so as it takes the new value
immediately, as the application calls for the cell value to change frequently
through a scroll bar.

"Luke M" wrote:

Can you do something like:

DDEExecute Channel, "[ContourViewChange(," & Range("A2").Value & ")]"

--
Best Regards,

Luke M
"Jason Falzon" wrote in message
...
I have an aplication called DPlot that can take commands from inside excel
using macros.

I managed to interact already with it using the following: -

Sub DownElevation()
'
' DownElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,-1)]"
DDETerminate Channel

End Sub
Sub UpElevation()
'
' UpElevation Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(,1)]"
DDETerminate Channel

End Sub
Sub LeftAzimuth()
'
' LeftAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(-1,)]"
DDETerminate Channel

End Sub
Sub RightAzimuth()
'
' RightAzimuth Macro
' Macro recorded 24/03/2010
'

'
Channel = DDEInitiate("DPlot", "System")
DDEExecute Channel, "[ContourViewChange(1,)]"
DDETerminate Channel

End Sub

I created a button for each macro and that works fine. But the problem is
that to acheive the disired result I have to click a lot of times on each
button. I know that I can replace the 1 and -1 with higher numbers but
then
that will be too course.

I was wondering if and how I could replace the 1 and -1 numbers with cell
contents, which cells contents are controlled via a scroll bar inside
excel.

I know how to use the scroll bars, but I cannot find the correct way to
declare the cells inside the macro and subsequently how to use them/their
value.



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.