I want to use the Rowcount as the second Parameter for the Range.
Set R = Range("A1", Range("A" & Rows.Count).End(xlUp))
Range("N2":R).Value =...
How is it possible to use R here as the second Parameter?
Best regards!
Can look as a more complicated but is logical:
Set R = Range("a1", cells(rows.count, "A").end(xlup))
range("N2", cells(r.rows.count, "N")).value=...
Step-by-step solution:
Set lastA = cells(rows.count, "A").end(xlup)
set R = range("A1", lastA)
range("N2", cells(lastA.row, "N")).value = ...
pls try with below
Sub test()
Dim r As Range
Set r = Range("A1", Range("A" & Rows.Count).End(xlUp))
Range("N2:N" & r.Rows.Count).Value = "R"
End Sub
Range("N2:N" & R).ValueRwas set as range