ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range of Object Global failed (https://www.excelbanter.com/excel-programming/344662-range-object-global-failed.html)

JasonSelf[_23_]

Range of Object Global failed
 

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

--
JasonSel
-----------------------------------------------------------------------
JasonSelf's Profile: http://www.excelforum.com/member.php...nfo&userid=533
View this thread: http://www.excelforum.com/showthread.php?threadid=48196


Jim Rech

Range of Object Global failed
 
Range("Formlas!B2") = "480"

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

--
Jim
"JasonSelf" wrote
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...fo&userid=5330
| View this thread: http://www.excelforum.com/showthread...hreadid=481967
|



Jim Thomlinson[_4_]

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

--
HTH...

Jim Thomlinson


"JasonSelf" wrote:


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...fo&userid=5330
View this thread: http://www.excelforum.com/showthread...hreadid=481967



JasonSelf[_24_]

Range of Object Global failed
 

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.


--
JasonSelf
------------------------------------------------------------------------
JasonSelf's Profile: http://www.excelforum.com/member.php...fo&userid=5330
View this thread: http://www.excelforum.com/showthread...hreadid=481967



All times are GMT +1. The time now is 01:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com