Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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???
.

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
Looping Maggie[_6_] Excel Discussion (Misc queries) 6 October 2nd 08 09:14 PM
Not Looping Roger Excel Discussion (Misc queries) 0 February 26th 08 05:18 PM
Looping a macro Sony Excel Discussion (Misc queries) 3 October 30th 06 11:52 AM
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
Looping between sheets picking up values on the way bungie Excel Worksheet Functions 3 March 5th 06 07:22 AM


All times are GMT +1. The time now is 04:12 PM.

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"