Range selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need help to write a formula for the following ;

Say I have some value in A1, and I want it to copy to number of cells, given
in A2, in the same row starting from A3.
A1="xxx", A2=2, A3,A4="xxx"
Thanks for immediate help.
 
Sub naveen()
Set r1 = Range("A1")
Set r2 = Range("A3:A" & 2 + Range("A2").Value)
r1.Copy r2
End Sub
 
Thanks for immediate response. Can we do it without macros meaning with
formulas in the range.
 
In A3 enter:

=IF(ROWS($A$1:A1)-1<$A$2,$A$1,"") and copy down

This is not a "true" copy, but it does the job
 
Back
Top