Hey Joel,
I am using Excel 2003 also. I finally figured out how to turn off the
"Required Variable Declaration" feature in the Options so hopefully that
will help. On my last attempt at running the code, it returned a "Run-time
error '424': Object required" message and highlighted the following lines
of code in yellow;
NewSht.Cells(RowCount, ColCount).Copy _
Destination:=SummarySht.Cells(NewRow, ColCount)
At this point when I run the code, it is creating a summary sheet at the end
of the Workbook, the Header columns are all there and it is returning 1 line
of information from the first Worksheet in the Workbook where it found a
cell that was highlighted in red.
The code in its entirety as I am currently trying to run it is;
Sub combinesheets()
Dim First As Boolean
Dim Sht As Worksheet
Dim SummarySht As Worksheet
Dim NewRow As Long
Dim LastCol As Long
Dim LastRow As Long
Dim AddedRow As Long
First = True
For Each Sht In ThisWorkbook.Sheets
If First = True Then
'create new summary worksheet
Set SummarySht = Worksheets.Add(after:=Sheets(Sheets.Count))
'copy header Row to new sheet
Sht.Rows(1).Copy Destination: = SummarySht.Rows(1)
NewRow = 2
First = False
End If
LastCol = Sht.Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sht.Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 2 To LastRow
AddedRow = False
For ColCount = 2 To LastCol
If Sht.Cells(RowCount, ColCount) = "" Or _
Sht.Cells(RowCount, ColCount). _
Interior.ColorIndex <> xlNone Then
If AddedRow = False Then
'add header column
SummarySht.Range("A" & NewRow).Value = _
Sht.Range("A" & RowCount).Value
AddedRow = True
End If
If Sht.Cells(RowCount, ColCount) = "" Then
'Add X for empty cells
SummarySht.Cells(NewRow, ColCount) = "X"
Else
NewSht.Cells(RowCount, ColCount).Copy _
Destination:=SummarySht.Cells(NewRow, ColCount)
End If
End If
Next ColCount
If AddedRow = True Then
AddedRow = AddedRow + 1
End If
Next RowCount
Next Sht
End Sub