I am trying to fix an old macro that someone else made a while ago. There are 2 drop down lists that are copied and pasted to a cell whenever data is imported using this macro. It seemed like everything was working fine because the data was being imported and there have not been any error messages. However, I recently noticed that the drop down list for "BadData" does not get copied and pasted to it's respective cell like it should. When I looked through the code, I noticed that the code for "Run Type" and "BadData" were identical except for the following two lines:
The drop down list for "Run Type" gets copied and pasted just fine. I am new to VBA so I just decided to try and fix the "BadData" code by simply changing
to
It seems like it should work because it works for "Run Type" but whenever I try to run the macro, Excel just crashes and asks me if I want to restart Excel and attempt to retrieve my workbook. Usually when I screw up a line of code, Excel stops the macro, gives me an error code and asks me if I want to Debug, and then takes me to the line of code that is causing trouble. I am not sure why Excel keeps crashing. Is it because I did something wrong with the code or does Excel just have some sort of bug that I am running into?
Here is the old code:
Here is the changed code:
Any help would be greatly appreciated. Thanks.
Bookmarks