I am trying to store a variable name firstRng into
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
Range("A"& lMaxRows + 1).Select
in place of "A"
here is what I have tried
Dim entireRange As Range
Dim firstRng As Range
Dim secondRng As Range
Set entireRange = Range("A2:C2")
Set secondRng = Range("B2")
Set firstRng = range("A:A")
entireRange.Select
secondRng.Activate
Selection.Copy
lMaxRows = Cells(Rows.Count, firstRng).End(xlUp).Row
Range(firstRng & lMaxRows + 1).Select
ActiveSheet.Paste
it will error on 1maxRows "Type mismatch"
firstRng.Cells(lMaxRows + 1).Set secondRng = Range("2")- that's not valid.firstRnguseCellsand notRangeand usefirstRng.Columnto return the column number:lMaxRows = Cells(Rows.Count, firstRng.Column).End(xlUp).RowAndCells(lMaxRows , firstRng).Select