Good morning all!
I am trying to pull in a table one column at a time from each worksheet and paste it in the worksheet("Main"). I have the code below to find the last row with data and then past it right underneath the next cell without data on the worksheet("main"). I have used something like the below before but for some reason I cant get it to work on this project. It errors out saying disqualifyer. on "X = .cells"
thanks for your help in advance.
I am trying to pull in a table one column at a time from each worksheet and paste it in the worksheet("Main"). I have the code below to find the last row with data and then past it right underneath the next cell without data on the worksheet("main"). I have used something like the below before but for some reason I cant get it to work on this project. It errors out saying disqualifyer. on "X = .cells"
thanks for your help in advance.
Code:
For Each wsSheet In Worksheets
'lastrow = Range("a65536").End(xlUp).Row
lastrow = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 10000
x = .Cells(Rows.Count, 15).End(xlUp).Row
If UCase(wsSheet.Name) <> "MAIN" Then
For Each Cell In Range("D6:D" & lastrow)
If IsEmpty(Cell.Value) = False Then
ActiveCell.Copy
Worksheets("Main").Activate
x
ActiveSheet.Paste
End If
Next wsSheet
End If