I want to combine data from multiple sheets. The sheets all have the same autogenerated name: A, A(2), A(3) etc. I can select the data and paste it in the combined sheet for the first sheet (A) but I cannot get it to work for any of the following sheets. The Issue is that I cannot use <> "combined" because there are other sheets (B,C & D) from which I do not need/want the data. Nor can I just name all the sheets because the number of sheets A(#) is variable too so I get an error when I try. So far this is the part that works:
Sheets("A").Select
Dim rgSelect As Range, c As Range
For Each c In ActiveSheet.Range("B:B")
If Not c = 0 Then
If rgSelect Is Nothing Then Set rgSelect = c
Set rgSelect = Union(rgSelect, c)
End If
Next c
rgSelect.EntireRow.Copy Destination:=Sheets("Combined").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Sheets("Combined").Select
Do you perhaps know a solution? I was reading about INDIRECT function but so far I haven't been able to get that to work
Lens(Sheet.name)toLen(Replace(Sheet.Name,"A",""))and if they are different, use the sheet.