Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 'go to' macros

I have set the following macro to unhide column Y in all sheets.

Dim sh As Worksheet
For Each sh In Sheets(Array("sheet1", "sheet2", "sheet3"))
sh.Columns("X:Z").EntireColumn.Hidden = False
Range("H7").Select
Next

However, how do I also get it to select sell H7 and also scroll to the
top left of the workbook in all sheets?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 'go to' macros

Hi FJDx

Try this

Sub Test()
Dim sh As Worksheet
For Each sh In Sheets(Array("sheet1", "sheet2", "sheet3"))
sh.Columns("X:Z").EntireColumn.Hidden = False
Application.GoTo sh.Range("H7"), True
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"FJDx" wrote in message ...
I have set the following macro to unhide column Y in all sheets.

Dim sh As Worksheet
For Each sh In Sheets(Array("sheet1", "sheet2", "sheet3"))
sh.Columns("X:Z").EntireColumn.Hidden = False
Range("H7").Select
Next

However, how do I also get it to select sell H7 and also scroll to the
top left of the workbook in all sheets?





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 'go to' macros

"Ron de Bruin" wrote in message
...
Hi FJDx

Try this

Sub Test()
Dim sh As Worksheet
For Each sh In Sheets(Array("sheet1", "sheet2", "sheet3"))
sh.Columns("X:Z").EntireColumn.Hidden = False
Application.GoTo sh.Range("H7"), True
Next
End Sub


Thank you. Is there an option to scroll to a certain area of each
worksheet selected as well?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 'go to' macros

If I understand you correct

For Each sh In ActiveWindow.SelectedSheets



--
Regards Ron de Bruin
http://www.rondebruin.nl


"FJDx" wrote in message ...
"Ron de Bruin" wrote in message
...
Hi FJDx

Try this

Sub Test()
Dim sh As Worksheet
For Each sh In Sheets(Array("sheet1", "sheet2", "sheet3"))
sh.Columns("X:Z").EntireColumn.Hidden = False
Application.GoTo sh.Range("H7"), True
Next
End Sub


Thank you. Is there an option to scroll to a certain area of each
worksheet selected as well?




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
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
Making excel macros run Word macros Matthew McManus Excel Programming 1 February 18th 04 02:57 AM
Macro Size Limit / open macros with macros? andycharger[_7_] Excel Programming 6 February 13th 04 02:00 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


All times are GMT +1. The time now is 06:08 AM.

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"