Good morning.
I need some help altering existing VBA. Right now, the code will paste under the last used row. I would like to modify this so that the copied data is pasted starting at B5 of the master, with each file pasting underneath.
What I currently have is this:
How can I modify the paste line to start at B5 of the master, then paste at the next blank for each file that is looped through?
Thank you all for the help!
I need some help altering existing VBA. Right now, the code will paste under the last used row. I would like to modify this so that the copied data is pasted starting at B5 of the master, with each file pasting underneath.
What I currently have is this:
Code:
'set to the current active workbook (the 'Master')
Set wbThis = ActiveWorkbook
Set sht1 = wbThis.Sheets("Master")
'Clear out old content
sht1.Range("B5:C34").ClearContents
Folder = "U:\Ships - Export Controlled Documents\Hopper\Hopper 8C1\PMO\_Daily PODs\Daily Updates"
Fname = Dir(Folder)
While (Fname <> "")
Set wbTarget = Workbooks.Open(Filename:=Folder & Fname)
vDB = wbTarget.Sheets(1).Range("A2:B9")
sht1.Range("b" & Rows.Count).End(xlUp)(2).Resize(UBound(vDB, 1), UBound(vDB, 2)) = vDB
Fname = Dir
'close the Daily POD file
wbTarget.Close
Wend
Thank you all for the help!
Last edited by a moderator: