Hi,
I have a calculate event macro that I need a little help rectifying. The event macro is stored in a sheet and should call 1 of 2 macros depending on if cell A231 is blank or not. The macro seemed to be doing what I need, but it seems there are a few bugs that are causing it to error out/not function the way I need it to.
1. I need the code to run if cell A231 on sheet "Code Sheet" changes. If A231 is blank, I need to run macro1, if A231 is not blank, I need to run macro2. Macro1 and macro2 are stored in a separate module. my event macro is stored in sheet "Code Sheet". Currently, my code is running if ANY cell in my workbook changes. Not good. I only need it to run if A231 on sheet "Code Sheet" calculates
2. The event procedure runs when I open another workbook. So if I have my primary workbook that contains the event macro open, and I open up another workbook, the code tries to run in the other workbook. I do not want this to happen. It also errors out when this happens because the sheet I'm referencing in macro1 and macro2 is not available in the newly opened workbook. How do I stop this? I would think I need to use ThisWorkbook somewhere in my code, but I'm sure sure where/how.
I would GREATLY appreciate input on these 2 issues. I feel I am almost there, but there are just a few little quirks I need help figuring out. Thanks in advance! My code is below:
Please Login or Register to view this content.
Please Login or Register to view this content.
Bookmarks