Need a little Macro ...

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I need a little Macro that will race thru my Tab Sheets
regardless of Tab Sheet Name ...

Active sheet ... perform a function ... next sheet ...
until all functions complete ... all sheets ...

Thanks ... Kha
 
Ken,

Try something like

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
' do something with WS
Next WS


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Chip ...

This is what I am using & it is not working ... its only
clearing the Active Sheet ...

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
Range("B16:AE16").Select
Selection.ClearContents
Next WS
Range("B18").Select
End Sub

I am going home ... will be back Monday ... Thanks for
your support ... Kha
 
Ken said:
Chip ...

This is what I am using & it is not working ... its only
clearing the Active Sheet ...

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
Range("B16:AE16").Select
Selection.ClearContents
Next WS
Range("B18").Select
End Sub

I am going home ... will be back Monday ... Thanks for
your support ... Kha

I think that you need to tell Excel which sheet to look on to find your
range.

One way to do this is to change your macro slightly by adding :
WS.Activate
Before:
Range("B16:AE16").Select

Hope this helps

Geoff
 
-----Original Message-----



I think that you need to tell Excel which sheet to look on to find your
range.

One way to do this is to change your macro slightly by adding :
WS.Activate
Before:
Range("B16:AE16").Select

Hope this helps

Geoff





.
 
Back
Top