![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 02:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com