Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default vb Command seems simple but...

What is a vbCommand for Ctrl + Home? I want to scroll up and left on all
worksheets in a Private Sub Workbook_Open when there are various Freeze Panes
settings, so I cannot select a particular cell in all sheets.

Thanks in advance,

Sam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default vb Command seems simple but...

One way:

Sub scrl()
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub


"Sam" wrote:

What is a vbCommand for Ctrl + Home? I want to scroll up and left on all
worksheets in a Private Sub Workbook_Open when there are various Freeze Panes
settings, so I cannot select a particular cell in all sheets.

Thanks in advance,

Sam

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default vb Command seems simple but...

The previous suggestion doesn't select the cell in the unfrozen area
as does Ctrl-Home. I assume that's what you want.

If you are looping through the worksheets by index number, you could
name the cell in each sheet to which you want to scroll (something
like GoHere1, GoHere2, etc), use your counter to append the sheet
index number to "GoHere" in a string variable and use Select to go to
each in turn.

Dim ULcell as String

[...]

ULcell = "GoHere" & CStr(<put your counter variable here)
Range(ULcell).Select

Of course, this fails miserably if the sheets are shuffled around.

There may be a simpler way, but I haven't found it.

Mark Lincoln

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default vb Command seems simple but...

What is a vbCommand for Ctrl + Home? I want to scroll up and left on all
worksheets in a Private Sub Workbook_Open when there are various Freeze
Panes
settings, so I cannot select a particular cell in all sheets.


I think this Workbook Open code will do what you want...

Private Sub Workbook_Open()
Dim WS As Worksheet
For Each WS In Worksheets
WS.Activate
With ActiveWindow
WS.Cells(.Panes(.Panes.Count).ScrollRow, _
.Panes(.Panes.Count).ScrollColumn).Activate
End With
Next
Worksheets(1).Activate
End Sub


Rick

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default vb Command seems simple but...

Try this:

Private Sub CommandButton2_Click()

With ActiveWindow.ActivePane
.LargeScroll , 256, , 256
Cells(.ScrollRow, .ScrollColumn).Select
End With

End Sub

However, I recall there are problem if rows/columns are hidden just under/to
the right of the split(s)
Also, the effect will depend on whether panes are frozen or not.

NickHK

"Sam" wrote in message
...
What is a vbCommand for Ctrl + Home? I want to scroll up and left on all
worksheets in a Private Sub Workbook_Open when there are various Freeze

Panes
settings, so I cannot select a particular cell in all sheets.

Thanks in advance,

Sam



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
Can I remove formula but keep value with a simple command? ls9811 Excel Discussion (Misc queries) 2 February 27th 09 08:28 PM
Simple question on With command teepee[_3_] Excel Discussion (Misc queries) 2 December 26th 08 06:27 PM
Simple replace command dspilberg Excel Programming 3 May 23rd 07 11:04 AM
search string command to answer simple Yes or No [email protected] Excel Worksheet Functions 0 February 21st 06 04:01 PM
Error running simple command quartz[_2_] Excel Programming 6 January 4th 05 08:05 PM


All times are GMT +1. The time now is 10:19 PM.

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

About Us

"It's about Microsoft Excel"