Hi there,
First of all, thank you in advance for your help and time
I am trying to compile in one sheet columns from different other sheets in one workbook.
The aim of the code below is to copy the content of the column "J" (excluding the 1 line) and copy on the B of the Master sheet. I assume this part of
Sheets("Securities").Select
With Range("J2")
.Resize(Cells(Rows.Count, "J").End(xlUp).Row - (.Row - 1), "1").copy
End With
Sheets("Master").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 2).Range("A1").Select
ActiveSheet.Paste
I assumethis part of code follows data that was already pasted (from other sheets) and also that column Ahas data on all its used lines. Reasonwhy I (xlDown) and then offset.
The formula works pretty well as long as there is data oncolumn J to copy but not if the column is empty
I am sure there is a workaround, but I am pretty newbiewith VBA, so I am very limited.
Thank you again
First of all, thank you in advance for your help and time
I am trying to compile in one sheet columns from different other sheets in one workbook.
The aim of the code below is to copy the content of the column "J" (excluding the 1 line) and copy on the B of the Master sheet. I assume this part of
Sheets("Securities").Select
With Range("J2")
.Resize(Cells(Rows.Count, "J").End(xlUp).Row - (.Row - 1), "1").copy
End With
Sheets("Master").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 2).Range("A1").Select
ActiveSheet.Paste
I assumethis part of code follows data that was already pasted (from other sheets) and also that column Ahas data on all its used lines. Reasonwhy I (xlDown) and then offset.
The formula works pretty well as long as there is data oncolumn J to copy but not if the column is empty
I am sure there is a workaround, but I am pretty newbiewith VBA, so I am very limited.
Thank you again