Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro control
How do I instruct a macro to respond to a variable outside of the VB editor?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete any control box and pictures | Excel Worksheet Functions | |||
control end in a macro | Excel Worksheet Functions | |||
Control button / macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
assign a macro to a control button | Excel Discussion (Misc queries) |