Range of Object Global failed

J

JasonSelf

I am getting a runtime error '1004'
Method 'Range' of object 'Global' failed

Private Sub OptionButton2_Click()
Sheets("Formulas").Visible = True
Range("Formlas!B2") = "480" <-----
Sheets("Formulas").Visible = False
Sheets("Panel").Select
End Sub

when I originally wrote this code it worked, however now I get th
run-time error. Does anyone know what would cause this and how I ge
the active object to be the Worksheet?

Thanks,
Jaso
 
J

Jim Rech

Range("Formlas!B2") = "480"

Looks as if you didn't spell the sheet name correctly. Btw, no need to make
the sheet visible.

--
Jim
in message |
| I am getting a runtime error '1004'
| Method 'Range' of object 'Global' failed
|
| Private Sub OptionButton2_Click()
| Sheets("Formulas").Visible = True
| Range("Formlas!B2") = "480" <-----
| Sheets("Formulas").Visible = False
| Sheets("Panel").Select
| End Sub
|
| when I originally wrote this code it worked, however now I get the
| run-time error. Does anyone know what would cause this and how I get
| the active object to be the Worksheet?
|
| Thanks,
| Jason
|
|
| --
| JasonSelf
| ------------------------------------------------------------------------
| JasonSelf's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=5330
| View this thread: http://www.excelforum.com/showthread.php?threadid=481967
|
 
G

Guest

Private Sub OptionButton2_Click()
with Sheets("Formulas")
.Visible = True
.Range("B2") = "480" <-----
.Visible = False
end with
Sheets("Panel").Select
End Sub
 
J

JasonSelf

Thanks,
The with method seems to have solved the problem...the spelling of
formulas was a typo in the forum, however I wouldn't have been
surprised if I had looked something that obvious over.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top