Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping through sheets
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??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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??? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping | Excel Discussion (Misc queries) | |||
Not Looping | Excel Discussion (Misc queries) | |||
Looping a macro | Excel Discussion (Misc queries) | |||
Looping | Excel Discussion (Misc queries) | |||
Looping between sheets picking up values on the way | Excel Worksheet Functions |