Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Programming equiv. of <Ctrl <Home

On a sheet, executing <Ctrl <Home moves the cursor to the top/left corner
of the "unfrozen" window (not just the displayed window) regardless of
horiz/vert scroll positions.

Anyone know how to code the same movement?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Programming equiv. of <Ctrl <Home

Sub CtrlHome()
Application.Goto Range("A1"), True
ActiveWindow.VisibleRange(1, 1).Select
End Sub

--
Regards,
Tom Ogilvy


"cawatson" wrote in message
...
On a sheet, executing <Ctrl <Home moves the cursor to the top/left

corner
of the "unfrozen" window (not just the displayed window) regardless of
horiz/vert scroll positions.

Anyone know how to code the same movement?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Programming equiv. of <Ctrl <Home

Tushar,

I appreciate your response but using the macro recorder does not work
because it creates a hard coded cell reference... This fails if the macro
"hides" that particular column on a subsequent running.

"Tushar Mehta" wrote:

In article ,
says...
On a sheet, executing <Ctrl <Home moves the cursor to the top/left corner
of the "unfrozen" window (not just the displayed window) regardless of
horiz/vert scroll positions.

Anyone know how to code the same movement?

Don't know if this will help, but what happens if you turn on the macro
recorder (Tools | Macro Record new macro...) and use the UI to carry
out a CTRL HOME?

Remember to turn off the recorder.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Programming equiv. of <Ctrl <Home

I guess I shouldn't have doubted you. I did not think this would do what the
OP was requesting as I thought it would goto cell A1. But I tested it and
sure enough it did work.

"Tom Ogilvy" wrote:

Sub CtrlHome()
Application.Goto Range("A1"), True
ActiveWindow.VisibleRange(1, 1).Select
End Sub

--
Regards,
Tom Ogilvy


"cawatson" wrote in message
...
On a sheet, executing <Ctrl <Home moves the cursor to the top/left

corner
of the "unfrozen" window (not just the displayed window) regardless of
horiz/vert scroll positions.

Anyone know how to code the same movement?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Programming equiv. of <Ctrl <Home

Tom,

Thanks... Your suggestion has me about 95%+ there but...

As written, this does in fact take me to the top/left of the "unfrozen"
window but, unlike the <Ctrl<Home keystroke combo does not take into acount
hidden columns (e.g. top/left of unfrozen area is D11 but macro has columns D
thru G hidden; <Ctrl<Home goes to H11 but code goes to D11)

Any thoughts?

-Carl

"Tom Ogilvy" wrote:

Sub CtrlHome()
Application.Goto Range("A1"), True
ActiveWindow.VisibleRange(1, 1).Select
End Sub

--
Regards,
Tom Ogilvy


"cawatson" wrote in message
...
On a sheet, executing <Ctrl <Home moves the cursor to the top/left

corner
of the "unfrozen" window (not just the displayed window) regardless of
horiz/vert scroll positions.

Anyone know how to code the same movement?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO FORMAT THE HOME KEY WITHOUT USING CTRL Shelley Excel Discussion (Misc queries) 3 December 2nd 09 06:20 PM
Ctrl/Home changes the Zoom HuskerAlumna95 Excel Discussion (Misc queries) 4 March 4th 09 09:23 PM
Ctrl+Home is not A1 Lilbit Excel Worksheet Functions 2 September 25th 08 06:20 PM
Home or Ctrl-Home noyb Excel Programming 7 December 6th 05 07:42 PM
Freezed Panes and CTRL+HOME Kevin McCartney Excel Programming 1 April 21st 05 12:06 PM


All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"