Hi All,
I am having a crisis as I can't figure out what is wrong with a macro I had written earlier, which was working flawlessly until recently.
My excel workbook contains 3 sheets and The following are some of the issues I observed while running through the code in break mode.
1. Copying values from one sheet to a specific cell in a specific sheet causes the value to be populated in the active sheet. Here's what the code looks like:
Assume I am on Sheet 2 Then:
Thisworkbook.Sheets("Sheet1").Activate
Range("A1").Value = "Test"
In this scenario, the value should have ideally been populated in Sheet 1 cell A1, but the value gets populated in Sheet 2 Cell A1....how is this possible? and why is this happening?
2. A simple range statement results in a 10004 Error. Ex: Range("A1").select To overcome this I have to specifically mention which sheet i am referring to i.e. If the active sheeet is Sheet1 I am assuming the above line should work fine, but I have to modify it to Sheets("Sheet1").Range("A1").Select .... Why?
I created a Test Workbook and the issue seems to be following in the workbook as well. The code is in the Sheet area of the workbook. In my actual file Im using a Button. Hope this adds more clarity. I've attached the Test workbook as well.
I am completely baffled, I am not sure if a setting has changed or if there is an issue with Excel or my computer. I am not sure if anyone has come across this issue, but I would really appreciate all the help I can get.
Thanks,
Steve
Bookmarks