nagonar,
A few things... please don't post duplicate threads. Also, always surround your code in code tags. Highlight code, and hit the # symbol in the menu.
see if this code works for you....
Sub test()
For csht = 1 To ActiveWorkbook.Sheets.Count 'worksheet or sheets
If Worksheets(csht).Visible = True Then
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
End Sub
Bookmarks