Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro control

How do I instruct a macro to respond to a variable outside of the VB editor?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Macro control

Sort of vague. Where is the variable? In a cell on a
worksheet? Need to us a little more input here.
-----Original Message-----
How do I instruct a macro to respond to a variable

outside of the VB editor?


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Macro control

I might suggest a couple ways, but not sure exactly what your trying to do.
Here's one example.

In the VB Editor "Project Explorer", right click on "ThisWorkbook", and
select "View Code". Click the drop down box on the left side, and pick
workbook. Now click the right drop down box and select
"SheetSelectionChange"

add the following code

If ActiveCell.Value = "test" Then
Range("B1").Value = "test"
Else
Range("B1").Value = ""
End If

Now, go to cell "A1" in your worksheet and type the word "test" (without the
quotes)

Now watch what happens in "B1" when you click the mouse on any cell except
"A1", then try clicking on "A1".

Is this anything like you're looking for? You can use other workbook events
to trigger your code. Look up "workbook object" in the VB Editor Help menu,
then select "Events"

Did this help?

D.S.


"Edwin Merced" wrote in message
...
How do I instruct a macro to respond to a variable outside of the VB

editor?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro control

But what I would like is to write in a cell and make that go to the code in
VBA. Is it possible?

"D.S." wrote in message
...
I might suggest a couple ways, but not sure exactly what your trying to

do.
Here's one example.

In the VB Editor "Project Explorer", right click on "ThisWorkbook", and
select "View Code". Click the drop down box on the left side, and pick
workbook. Now click the right drop down box and select
"SheetSelectionChange"

add the following code

If ActiveCell.Value = "test" Then
Range("B1").Value = "test"
Else
Range("B1").Value = ""
End If

Now, go to cell "A1" in your worksheet and type the word "test" (without

the
quotes)

Now watch what happens in "B1" when you click the mouse on any cell

except
"A1", then try clicking on "A1".

Is this anything like you're looking for? You can use other workbook

events
to trigger your code. Look up "workbook object" in the VB Editor Help

menu,
then select "Events"

Did this help?

D.S.


"Edwin Merced" wrote in message
...
How do I instruct a macro to respond to a variable outside of the VB

editor?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Macro control

Not that I know of.

D.S.
"Edwin Merced" wrote in message
...
But what I would like is to write in a cell and make that go to the code

in
VBA. Is it possible?

"D.S." wrote in message
...
I might suggest a couple ways, but not sure exactly what your trying to

do.
Here's one example.

In the VB Editor "Project Explorer", right click on "ThisWorkbook", and
select "View Code". Click the drop down box on the left side, and pick
workbook. Now click the right drop down box and select
"SheetSelectionChange"

add the following code

If ActiveCell.Value = "test" Then
Range("B1").Value = "test"
Else
Range("B1").Value = ""
End If

Now, go to cell "A1" in your worksheet and type the word "test" (without

the
quotes)

Now watch what happens in "B1" when you click the mouse on any cell

except
"A1", then try clicking on "A1".

Is this anything like you're looking for? You can use other workbook

events
to trigger your code. Look up "workbook object" in the VB Editor Help

menu,
then select "Events"

Did this help?

D.S.


"Edwin Merced" wrote in message
...
How do I instruct a macro to respond to a variable outside of the VB

editor?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete any control box and pictures Steve Excel Worksheet Functions 2 February 9th 10 09:46 PM
control end in a macro Belinda7237 Excel Worksheet Functions 1 May 28th 08 05:22 PM
Control button / macro Sarah Excel Discussion (Misc queries) 2 February 11th 07 04:45 AM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
assign a macro to a control button ewan72 Excel Discussion (Misc queries) 1 December 3rd 04 02:04 PM


All times are GMT +1. The time now is 06:43 AM.

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

About Us

"It's about Microsoft Excel"