To omit hidden sheets you need to tell the code to do such. Also, make sure your sheet references are what you want. Each range should have a proper sheet reference in your scenario.
For csht = 1 To ActiveWorkbook.Sheets.Count 'worksheet or sheets
If Sheets(csht).Visible = xlSheetVisible Then 'will only apply to visible sheets
With ActiveSheet
lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
For teller = 11 To lastRow
'print no of worksheets
Cells(I + 1, 3) = ActiveWorkbook.Worksheets.Count
'print sheetname
Cells(I + 1, 4) = Sheets(csht).Name
Range(Cells(I + 1, 5), Cells(I + 1, 25)) = Sheets(Sheets(csht).Name).Range("A" & teller & ":Z" & teller).Value
I = I + 1
Next teller
End If
Next csht
Bookmarks