I have a macro which selects my first cell used in column M (variable is Firstrow). This macro detects the last cell used in column M (variable is lastrow).
I would like that my macro selects from first cell used in column M to last cell used in column M.
I tried:
Range (Firsttrow & "M:M" & lastrow)
but I got an error message
“Compile error: invalid use of property”
Sub Selectfromfirstrowusedtolastrowusedused()
Dim lastrow, Firstrow As Long
lastrow = ActiveSheet.Range("M" & Rows.Count).End(xlUp).Row
Firstrow = Range("M1").End(xlDown).Row
Debug.Print Firstrow
Debug.Print lastrow
Range (Firsttrow & "M:M" & lastrow)
End Sub