roberttkim
Board Regular
- Joined
- Mar 5, 2009
- Messages
- 97
Hi everyone. Wondering if someone can help me edit this code. Really appreciate it. The code below opens an html file saved on network drive location in a cell B2 and copy pastes the content of that file to sheet data. It then opens another file based on location in cell B3 and copy pastes the content to the sheet data. However, i need it copy and paste it to the last row with no data on the data sheet instead of overwriting everything. The last piece of code closes all the html files opened. Please help.
VBA Code:
Dim NmStr As String
NmStr = ActiveWorkbook.Name
Windows(NmStr).Activate
Report = Sheets("RECON").Range("B2").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("Data").Select
Range("A1").Select
ActiveSheet.Paste
Report = Sheets("RECON").Range("B3").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("Data").Select
Range("A1").Select
ActiveSheet.Paste
Workbooks.Application.CutCopyMode = False
Workbooks(Sheets("RECON").Range("A2").Value).Close False
Workbooks.Application.CutCopyMode = False
Workbooks(Sheets("RECON").Range("A3").Value).Close False