I am trying to write a macro that selects any lines with text in a specific column (it does not matter which text), and then insert it into the summary sheet, for this I need to iterate over all the sheets in the workbook panel, Summary sheet. However, I have problems with its operation, I continue to get "Compile Error: Method or Data Member not Found", I need the macro to look through all the sheets, regardless of the name, since the sheets are eventually archived and new ones added.
Now I have changed the way the macro finds cells with text in below, I do not know if this will change the situation:
Sub SmartCopy ()
Dim s1 As Worksheet, s2 As Worksheet
Dim N As Long, i As Long, j As Long
Set s1 = Sheets("Customer 1")
Set s2 = Sheets("Action Summary")
N = s1.Cells(Rows.Count, "C").End(xlUp).Row
j = 2
For i = 6 To N
If s1.Cells(i, "C").Value = "" Then
Else
s1.Cells(i, "C").EntireRow.Copy s2.Cells(j, 1)
j = j + 1
End If
Next i
End Sub
I'm new to this and probably totally wrong, but any help would be appreciated.