View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob A[_2_] Bob A[_2_] is offline
external usenet poster
 
Posts: 2
Default moving from sheet to sheet

wow, thank you VERY much for your great help!
--
Bob A


"Mike H" wrote:

Hi,

There are several ways, this loops through an array of named sheets

Sub Sonic()
Dim V As Variant
Dim S As String
Dim sh As Worksheet
S = "Sheet1,Sheet2,Sheet3"
V = Split(S, ",")
For Each sh In ThisWorkbook.Worksheets
If Not IsError(Application.Match(CStr(sh.Name), V, 0)) Then
'do things
MsgBox sh.Name
End If
Next sh
End Sub


Mike

"Bob A" wrote:

I need to write code that automatically moves from sheet to sheet and gathers
data. I have no problem gathering the data on the sheet but I don't know how
to move the pointer to the next sheet in the workbook.
I would really appreciate any help you can give.
--
Bob A