Range("Reset Sheet!F13").Select Makes VBA Code Fail

T

ToferKing

I have a routine I am writing that causes the current sheet's visible
property to change to false and then takes the user to a Reset Sheet. Once
the person gets to the Reset Sheet, I want the routine to select cell F13 and
enter the phrase, "This sheet is hidden."

Well, I think I am stuck in R1C1 reference versus the other kind of
reference - whatever that is called.

My routine fails at this line.

Range("Reset Sheet!F13").Select

I have a feeling my VBA code wants me to use R1C1 type coding, but that
won't work because I don't know where the cursor will be when the user is
returned to the Reset Sheet.

Can you guys help me get this line to work using the specific cell reference?

Thanks
 
J

Jim Cone

You have to select the sheet first, then select the range.
However you don't have to select either to enter a value in a range...
Worksheets("Reset Sheet").Range("F13").Value = "This sheet is hidden"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"ToferKing" <[email protected]>
wrote in message
I have a routine I am writing that causes the current sheet's visible
property to change to false and then takes the user to a Reset Sheet. Once
the person gets to the Reset Sheet, I want the routine to select cell F13 and
enter the phrase, "This sheet is hidden."

Well, I think I am stuck in R1C1 reference versus the other kind of
reference - whatever that is called.

My routine fails at this line.

Range("Reset Sheet!F13").Select

I have a feeling my VBA code wants me to use R1C1 type coding, but that
won't work because I don't know where the cursor will be when the user is
returned to the Reset Sheet.
Can you guys help me get this line to work using the specific cell reference?
Thanks
 
G

Gary Keramidas

one way
worksheets("Reset Sheet").range("f13").select

or

worksheets("Reset Sheet").range("f13").value = "This sheet is hidden."
 

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