I am getting a compile error 'type mismatch' on my loop function below. I am trying to combine multiple worksheets in a master worksheet and it would help to have a loop function through them. Any help would be appreciated.
Thanks,
Public Sub combine2()
Dim i As Worksheet
For i = 1 To Worksheet.Count
Worksheets(i).Select
Columns("A:B").Select
Selection.copy
Sheets("sheet").Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
ActiveSheet.Paste
Range("A1").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select
Next i
End Sub
Dim i As IntegerandFor i = 1 To Worksheets.Countand see if that helps.