Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Visible sheets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steph - 31 Jan 2006 22:18 GMT
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
Norman Jones - 31 Jan 2006 22:35 GMT
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

> Hello.  The bwlow snippet of code return each sheet in a workbook.  Is
> there
[quoted text clipped - 4 lines]
> sh.Name
>        j = j + 1
Dave Peterson - 31 Jan 2006 22:38 GMT
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

> 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!
[quoted text clipped - 3 lines]
> sh.Name
>         j = j + 1

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.