LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 1
Default Run Macro on multiple worksheets

Hello,

I am trying to create a macro to run on all worksheets within a tab. So far it is only running on one worksheet and it does not work on other. Can someone please assist me. Below is the code I used. Thank you

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Name < "Sheet1" Or ws.Name < "Sheet2" Then
Columns("F:H").Select
Range("H1").Activate
Selection.EntireColumn.Hidden = True
End If

Next ws.Activate
End Sub
 
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
Macro for Multiple Worksheets Excel Hates Me Excel Programming 6 July 16th 10 11:43 AM
run macro in multiple worksheets SteveDB1 Excel Programming 9 June 13th 08 04:29 PM
how to make a macro to clear multiple cells from multiple worksheets? [email protected] Excel Worksheet Functions 2 October 18th 07 04:31 PM
MACRO AND MULTIPLE WORKSHEETS Mel Excel Worksheet Functions 8 January 21st 07 02:53 PM
Macro for multiple worksheets Amber[_3_] Excel Programming 3 January 20th 06 08:51 PM


All times are GMT +1. The time now is 03:55 AM.

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"