Not the fastest way or best way but ...since you don't want to transfer blank lines....
also note that it will add some text at end of text for each sheet this is to know when to step out of it.
Sub test()
'this is under the assumption you have 4 sheets in 1 workbook , having the date you want to merge on the 4th sheet
'remember to adjust the namines of the sheets where indicated with ////change////
For S = 1 To 3
Dim sheetnaming As String
If S = 1 Then
sheetnaming = "your first name" '////change////
Sheets(sheetnaming).Cells(65000, 1).End(xlUp).Offset(1, 0).Value = "Last Line"
ElseIf S = 2 Then
sheetnaming = "your second name" '////change////
Sheets(sheetnaming).Cells(65000, 1).End(xlUp).Offset(1, 0).Value = "Last Line"
ElseIf S = 3 Then
sheetnaming = "your third name" '////change////
Sheets(sheetnaming).Cells(65000, 1).End(xlUp).Offset(1, 0).Value = "Last Line"
End If
For i = 1 To 65000
Dim transfer As String
transfer = Sheets(sheetnaming).Range("A" & i).Value
'////change the 3in1 in blow lines////
If transfer = "Last Line" Then
Sheets("3in1").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = "--------------------------------------------------------------------------"
GoTo endofsheetdata:
Else
If transfer = "" Then
Else
Sheets("3in1").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = transfer
End If
End If
Next i
endofsheetdata:
Next S
End Sub
Bookmarks