View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Derek[_2_] Derek[_2_] is offline
external usenet poster
 
Posts: 6
Default Looping through sheets

Sub loopSheets()
Dim wkSht As Worksheet

For Each wkSht In Worksheets
' code
Next wkSht
End Sub
-----Original Message-----
I want to be able to loop through sheets that I have
created but I am unsure of how to do it. I am experienced
with For...Next loops, just not with sheets. What I am
trying to accomplish is below...

Dim cell as Range
'Dim sheet as Range - remarked out for now...
For each sheet...

For Each cell In Range("A2:A200").Cells
Select Case cell.Value

Case 151
cell.Value = "Fall Audit"
With cell.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Case 175
cell.Value = "Fall Audit"
With cell.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Case Else
Exit For
End Select
Next cell

Next sheet

Any ideas???
.