Results 1 to 25 of 25

URGENT: Macro That Worked Fine Not Working Now - No Changes Made To Code

Threaded View

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    17

    URGENT: Macro That Worked Fine Not Working Now - No Changes Made To Code

    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
    Attached Files Attached Files
    Last edited by stevevb; 05-15-2013 at 12:05 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1