Range in VBA

  • Thread starter Thread starter Jim Orson
  • Start date Start date
J

Jim Orson

I have the following code in a workbook:
Private Sub Workbook_Open()
Sheets("Misc Summary").Activate
Range("C12").Select
End Sub

Rather than the range "C12", I want to select the cell that is located by
the "Ctrl-Home" keystroke. The location of this cell changes as I change
location of the frozen panes throughout the year. Is there a way to replace
the "C12" range in the above code with the equivalent of the "Ctrl-Home"
keystroke?

Thanks for any help!

Jim Orson...
 
Hi Jim,

Sendkeys will do it

SendKeys "^{HOME}"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bob, us Dorset boys have got to start a team!

Regards
Roger
(Blush) actually in Wiltshire at the moment......
 
After I posted I saw your other note that said that.

Are you born and bred or an invader?

Bob
 
Roger & Bob,

I was not aware of SendKeys. Works like a charm. Thanks much!

Jim Orson...
 
Back
Top