Thread: Autofill
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
paulinoluciano
 
Posts: n/a
Default Autofill

"Is there some VBA code with which could I autofill the column B with
some formula exactly with the same size in A while this could be
variable among the sheets?"
I have used the code:

Sub Macro1()
Range("B1").Select
ActiveCell.FormulaR1C1 = "Random 1"
Selection.AutoFill Destination:=Range("B1:B20")
End Sub

But in this case I have the fills with the words Random 1, Random 2,
Random 3,... Random 20. The problem is that in other situations the
random numbers could be 1000 or more and I would not like to do that
manually.