1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel: Run-time Error 1004 During Macro

Discussion in 'Business Applications' started by Monty75, Jan 22, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Monty75

    Monty75 Thread Starter

    Joined:
    Jan 25, 2000
    Messages:
    58
    I have attached a spreadsheet. The first tab (Setup) has buttons 1,2,3,4,5. The purpose of these buttons is to have different years investments. I have a tab (Sheet1) that is hidden in the spreadhseet. Each macro unhides, then changes about 3 formulas on the Investment Analysis Tool tab, simply changing the cell reference. Only it does't ' change. It errors out with the above error. I've never see anything like this happen! Thanks in advance for the help.
     

    Attached Files:

  2. OBP

    OBP Temporarily Banned

    Joined:
    Mar 8, 2005
    Messages:
    19,889
    Monty75, I am sorry but the spreadsheet that you posted does not have any buttons visible.
    The Code is there and I have looked at and run it and the problem is that the Code is not on Sheets("Investment Analysis Tool").Select
    This is a quirk of Excel, You need to put activesheet. in from of your "Range selection" like so
    ActiveCell.FormulaR1C1 = "=Sheet1!R[31]C[-2]"
     
  3. Zack Barresse

    Zack Barresse

    Joined:
    Jul 25, 2004
    Messages:
    5,452
    Why activate at all? In fact, why even uhhide it? Just because you can't see it doesn't mean you can't write to it. The only thing you need to worry about is protection. Being visible is NOT a requirement to write to it.

    And ALWAYS explicitly set your sheet reference. That is just good habit. :)
     
  4. Monty75

    Monty75 Thread Starter

    Joined:
    Jan 25, 2000
    Messages:
    58
    Thanks gentelmen. I appreciate the tutelage. I'll mark this thread as solved.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/436411

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice