Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Place Cursor in A1 on all Sheets Q

I have the code below which moves the cursor to A1 on all Sheets.
Problem is that I have a number of Hidden sheets which I do not want
the Cursor to move to A1, how can I do this i.e. ignore any hidden
sheets?

Thanks


Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Object
Dim Sh1 As Object
Set Sh1 = ActiveSheet
For Each sh In ActiveWorkbooks.Worksheets
sh.Activate
Range("A1").Select
Next
Sh1.Activate
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Place Cursor in A1 on all Sheets Q

you can try something like this


Sub test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select False
End If
Next
Range("Q1").Select
Worksheets(1).Select
End Sub

--


Gary

"Sean" wrote in message
oups.com...
I have the code below which moves the cursor to A1 on all Sheets.
Problem is that I have a number of Hidden sheets which I do not want
the Cursor to move to A1, how can I do this i.e. ignore any hidden
sheets?

Thanks


Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Object
Dim Sh1 As Object
Set Sh1 = ActiveSheet
For Each sh In ActiveWorkbooks.Worksheets
sh.Activate
Range("A1").Select
Next
Sh1.Activate
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Place Cursor in A1 on all Sheets Q

sorry, had a typo, should be
Range("A1").Select
--


Gary


"Gary Keramidas" wrote in message
...
you can try something like this


Sub test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select False
End If
Next
Range("Q1").Select
Worksheets(1).Select
End Sub

--


Gary

"Sean" wrote in message
oups.com...
I have the code below which moves the cursor to A1 on all Sheets.
Problem is that I have a number of Hidden sheets which I do not want
the Cursor to move to A1, how can I do this i.e. ignore any hidden
sheets?

Thanks


Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Object
Dim Sh1 As Object
Set Sh1 = ActiveSheet
For Each sh In ActiveWorkbooks.Worksheets
sh.Activate
Range("A1").Select
Next
Sh1.Activate
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Place Cursor in A1 on all Sheets Q

On Aug 14, 8:14 am, "Gary Keramidas" <GKeramidasATmsn.com wrote:
sorry, had a typo, should be
Range("A1").Select
--

Gary

"Gary Keramidas" wrote in message

...



you can try something like this


Sub test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select False
End If
Next
Range("Q1").Select
Worksheets(1).Select
End Sub


--


Gary


"Sean" wrote in message
roups.com...
I have the code below which moves the cursor to A1 on all Sheets.
Problem is that I have a number of Hidden sheets which I do not want
the Cursor to move to A1, how can I do this i.e. ignore any hidden
sheets?


Thanks


Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Object
Dim Sh1 As Object
Set Sh1 = ActiveSheet
For Each sh In ActiveWorkbooks.Worksheets
sh.Activate
Range("A1").Select
Next
Sh1.Activate
End Sub- Hide quoted text -


- Show quoted text -


Thanks Gary, works a treat

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
Have cursor go to specific place when worksheet opens? [email protected] Excel Discussion (Misc queries) 1 July 9th 08 03:24 AM
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Select which cell enter will place the cursor mbing916 Excel Discussion (Misc queries) 3 May 1st 07 05:17 PM
Keeping cursor in same place on all worksheets in a workbook Phil Burgess Excel Worksheet Functions 1 December 23rd 05 01:32 PM
why can't I place the cursor directly on certain cells? KG Excel Discussion (Misc queries) 3 January 31st 05 11:26 PM


All times are GMT +1. The time now is 05:24 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"