angelmaine4ever
New Member
- Joined
- Nov 1, 2017
- Messages
- 10
Hi I have this formula below (thanks Rick Rothstein!) that combines all worksheet data in to one worksheet.
However, I need to exclude those worksheets/tab with no data at all (only with header).
PLEASE HELP ME! THANK YOU!!!
Sub Button2_Click()
Dim NextRow As Long, Sht As Worksheet
For Each Sht In Worksheets
If Sht.Name <> "Master" And Sht.Name <> "READ ME" And Sht.Name <> "PRIDE Ratings' Distribution" And Sht.Name <> "Computation" Then
NextRow = Sheets("Master").Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row + 1
Sheets("Master").Cells(NextRow, "A").Value = Sht.Name
Sheets("Master").Cells(NextRow, "B").Resize(Sht.UsedRange.Rows.Count, 9) = Sht.UsedRange.Offset(1).Value
End If
Next
End Sub
However, I need to exclude those worksheets/tab with no data at all (only with header).
PLEASE HELP ME! THANK YOU!!!
Sub Button2_Click()
Dim NextRow As Long, Sht As Worksheet
For Each Sht In Worksheets
If Sht.Name <> "Master" And Sht.Name <> "READ ME" And Sht.Name <> "PRIDE Ratings' Distribution" And Sht.Name <> "Computation" Then
NextRow = Sheets("Master").Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row + 1
Sheets("Master").Cells(NextRow, "A").Value = Sht.Name
Sheets("Master").Cells(NextRow, "B").Resize(Sht.UsedRange.Rows.Count, 9) = Sht.UsedRange.Offset(1).Value
End If
Next
End Sub