I'm attempting to consolidate data from multiple worksheets into one, using a method described here.
The difference is I only want a single column of data from each file copied so I have modified my code thus:
With wsMaster
erow = .Range("B" & .Rows.Count).End(xlUp).Row 'get the last row in column B
'~~> Copy from the file you opened
wsTemp.Range("A2:A" & .Rows.Count).Copy 'copy data in column A starting at row 2
'to however long the data runs for
'~~> Paste on your master sheet below last used row in column B
.Range("B" & erow).Offset(1, 0).PasteSpecial xlPasteValues
End With
This works for the first iteration (it copies the first source file correctly) but when it gets to the second source file it throws an error "Run-time error '1004': PasteSpecial method or Range class failed".
When in debug mode, I try to manually click and Ctrl+V the copied data, it says the size/shape of the ranges don't match. HOWEVER - if I click in any cell at or above Row 2, it pastes the data it has copied in the macro, without complaining.
Any ideas?