See code below.
This code copies columns a-d of other tracking sheets...problem im having is it pasted to the next available A cell but if there is not data in A and data in B, C, or D it cuts off and overwrites that data. I need the code to reflect copy to the next available SET of cells based on the next available empty cell after searching through A, B, C and D. Thanks in advance!
Code:
Sub runallmacros()
Dim wbSource As Workbook
Dim wsDest As Worksheet
Dim row As Integer, os As Integer
Set wsDest = ThisWorkbook.Worksheets("File Copier")
row = 2
os = 0
With wsDest
Do While .Range("K" & row).Value <> ""
Set wbSource = Workbooks.Open(wsDest.Range("K" & row).Value)
wbSource.Worksheets(1).Range("A5:D500").Copy
Application.DisplayAlerts = False
wbSource.Close
Application.DisplayAlerts = True
If .Range("A1").Value <> "" Then os = 1
.Range("A" & .Rows.Count).End(xlUp).Offset(os).PasteSpecial
row = row + 1
Loop
End With
Set wbSource = Nothing
End Sub
This code copies columns a-d of other tracking sheets...problem im having is it pasted to the next available A cell but if there is not data in A and data in B, C, or D it cuts off and overwrites that data. I need the code to reflect copy to the next available SET of cells based on the next available empty cell after searching through A, B, C and D. Thanks in advance!