View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Steve Steve is offline
external usenet poster
 
Posts: 1,814
Default Cycle through non-hidden pages only

Thanks Kevin
Works great!
Steve

"Kevin B" wrote:

The following code will not run, but hopefully it will point you in the
proper direction. Using the IF statement to determine whether or not
something happens to a particular worksheet in the current workbook:

Sub VisibleOnly()

Dim wb As Workbook
Dim ws As Worksheet

Set wb = ThisWorkbook

For Each ws In wb.Worksheets
If ws.Visible Then
Do something here
End If
Next ws

Set ws = Nothing
Set wb = Nothing

End Sub

--
Kevin Backmann


"Steve" wrote:

I have a workbook with several hidden pages. I'm trying to write some vb code
that will cycle though the Visible pages and ignore those that are hidden.
Any help would be greatly appreciated.
Thanks Steve