Can someone please help?
What is the shortest excel-vba code to copy all of column B (starting a cell B2) from Book1.xls to Column B (starting at cell B2) in Book2?
I will be copying multiple files Book1, Book2, and Book3. Book2 and Book3 need to be pasted in the blank space (lastrow +1) in column B.
Sub CopyWorkbooks1()
Workbooks.Open "C:\test\RESOURCE\Book1.xls"
Range("B2:E15").Copy
Workbooks.Open "C:\test\PUBLISH\PubFile.xls"
Range("B2").Select
ActiveSheet.Paste
'activate, copy, and, paste G and H -- F and G
Workbooks("book1.xls").Activate
Range("G2:H15").Copy
'activate and paste to PubFile
Workbooks("pubfile.xls").Activate
Range("F2:G15").Select
ActiveSheet.Paste
End Sub
Sub LastRowMacro1()
Dim ws As Worksheet
Set ws = ActiveSheet
For Each cell In ws.Columns(2).Cells
If IsEmpty(cell) = True Then cell.Select: Exit For
Next cell
End Sub
Your help is greatly appreciated.