Solved: Excel: Run-time Error 1004 During Macro

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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.
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
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]"
 
Joined
Jul 25, 2004
Messages
5,458
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. :)
 

Monty75

Thread Starter
Joined
Jan 25, 2000
Messages
58
Thanks gentelmen. I appreciate the tutelage. I'll mark this thread as solved.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Members online

Top