Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
I have a macro that changes a cell value, for example it changes the
value of cell "A1", I have another macro that I have set to run in the worksheet_change event when "A1" is changed. My problem is when I run the first macro and it changes the value in "A1" in doesn't run the second macro. Is there something I need to do so it will recognize the change in "A1" and consider it as the target so my second macro will run? Any help would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
Does the first macro disable events?
-- Regards, Tom Ogilvy " wrote: I have a macro that changes a cell value, for example it changes the value of cell "A1", I have another macro that I have set to run in the worksheet_change event when "A1" is changed. My problem is when I run the first macro and it changes the value in "A1" in doesn't run the second macro. Is there something I need to do so it will recognize the change in "A1" and consider it as the target so my second macro will run? Any help would be greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
One suggestion is not to use hard codes for Text cells
Declaring cell as Const. Then I simply change the const statement rather than changing a lot of code. " wrote: I have a macro that changes a cell value, for example it changes the value of cell "A1", I have another macro that I have set to run in the worksheet_change event when "A1" is changed. My problem is when I run the first macro and it changes the value in "A1" in doesn't run the second macro. Is there something I need to do so it will recognize the change in "A1" and consider it as the target so my second macro will run? Any help would be greatly appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
On Feb 14, 11:17 am, Joel wrote:
One suggestion is not to use hard codes for Text cells Declaring cell as Const. Then I simply change the const statement rather than changing a lot of code. " wrote: I have a macro that changes a cell value, for example it changes the value of cell "A1", I have another macro that I have set to run in the worksheet_change event when "A1" is changed. My problem is when I run the first macro and it changes the value in "A1" in doesn't run the second macro. Is there something I need to do so it will recognize the change in "A1" and consider it as the target so my second macro will run? Any help would be greatly appreciated.- Hide quoted text - - Show quoted text - If I remember, you can't declare a cell, since it's not an object in the Object Model. You have to declare the range, in this case, a single cell. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
Yeah I had the code set like this
Application.EnableEvents = False 'code 'code 'code 'more code Application.Run "MyMacro" Application.EnableEvents = True If I take out the EnableEvents line is works however know in my second macro I have it creating a validation list in a cell that is offset from the target. It works when I change the cell manually but when my first macro changes the cell I get a runtime error '1004': Application- defined or Object defined error. Any ideas why? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
MACRO HELP
I think people would have to see all the code to suggest anything. Indicate
which line is highlighted when you get the error message. Also indicate where the elements of the code are located - in a general module or in a sheet module and if in a sheet module, which sheet module each is in. I suspect your problem is in a reference - so if you qualify all your range references with what sheet they are located on, then perhaps that will solve the problem. this may be true for the reference you are using in the data validation as well. -- Regards, Tom Ogilvy " wrote: Yeah I had the code set like this Application.EnableEvents = False 'code 'code 'code 'more code Application.Run "MyMacro" Application.EnableEvents = True If I take out the EnableEvents line is works however know in my second macro I have it creating a validation list in a cell that is offset from the target. It works when I change the cell manually but when my first macro changes the cell I get a runtime error '1004': Application- defined or Object defined error. Any ideas why? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |