Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Visible sheets

Hello. The bwlow snippet of code return each sheet in a workbook. Is there
a way to return on sheets that are visible? Thank you!

For Each sh In bk.Worksheets
ThisWorkbook.Worksheets("Sheet Verify").Cells(cell.Row, j).Value =
sh.Name
j = j + 1


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Visible sheets

Hi Steph,

Try something like:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim j As Long
For Each SH In ActiveWorkbook.Worksheets
If SH.Visible = True Then
j = j + 1
ThisWorkbook.Worksheets("Sheet Verify"). _
Cells(1, j).Value = SH.Name
End If
Next SH

End Sub
'<<=============


---
Regards,
Norman



"Steph" wrote in message
...
Hello. The bwlow snippet of code return each sheet in a workbook. Is
there
a way to return on sheets that are visible? Thank you!

For Each sh In bk.Worksheets
ThisWorkbook.Worksheets("Sheet Verify").Cells(cell.Row, j).Value =
sh.Name
j = j + 1




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Visible sheets

for each sh in bk.worksheets
if sh.visible = xlsheetvisible then
ThisWorkbook.Worksheets("Sheet Verify").Cells(cell.Row, j).Value _
= sh.Name
j = j + 1
end if
next sh

Steph wrote:

Hello. The bwlow snippet of code return each sheet in a workbook. Is there
a way to return on sheets that are visible? Thank you!

For Each sh In bk.Worksheets
ThisWorkbook.Worksheets("Sheet Verify").Cells(cell.Row, j).Value =
sh.Name
j = j + 1


--

Dave Peterson
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
3 sheets in workbook, but visible only one? slaya_cz Excel Discussion (Misc queries) 3 September 30th 05 01:37 PM
Printing all Visible sheets Darin Kramer Excel Programming 2 March 30th 05 05:38 PM
visible sheets Bombermanx Excel Programming 3 November 12th 04 02:03 PM
HELP!! Cannot set any sheets to visible cassidyr1[_4_] Excel Programming 1 October 27th 04 02:19 PM
HELP!! Cannot set any sheets to visible cassidyr1[_3_] Excel Programming 1 October 26th 04 06:36 PM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"