I Have the below Chunk of Excel VBA Code . Now I'll have to put them In a Loop & Parametrize them.
Countruz2 = 2
Countruz3 = Countruz2 + 13
Range("A2:A15").PasteSpecial (xlPasteValues)
Below is what I've tried - 3 variants all failing with: Invalid use of Property Error.
' Range ("A" & Countruz2 & ":" & "A" & Countruz3) ' Invalid Use of Property
' Range ("A" & Countruz2 & ":A" & Countruz3) ' Invalid Use of Property
' Range ("A" & Countruz2 & ":A" & Countruz2 + 13) ' Invalid Use of Property
How do we deal with Such Concatenations & Parametrizations within the Range function in Excel VBA ?
Thanks for all the help in advance.
Edit :
Got it working after concatenating it like this -
X = "A" & Countruz2 & ":" & "A" & (Countruz2 + 13) Debug.Print X Range(X).PasteSpecial (xlPasteValues)
Any other elegant / simpler way?