View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default AutoFill on selection

Does progressive mean that you want to fill the cells row by row (one by one)?

Or you just want to fill that formula into a larger range--say based on the last
cell used in column A?

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:b" & LastRow)
End With
End Sub


Desert Piranha wrote:

Hi all,

Trying to use AutoFill on a selected range instead of a hardcoded
range. Ie: if i have a formula in B1,
then i select B1 and highlight a range. I want the formula copied as
progressive into the range.
Trying stuff like this with no joy.

Sub FillTest()
With Selection
'.AutoFill Destination = fillRange
'.AutoFill (Destination = fillRange)
'SourceRange.AutoFill Destination:=fillRange
End With
End Sub

Sub FillTest()
Selection.AutoFill Destination:=ActiveCell.Range("Want Selected range
here"), _
Type:=xlFillDefault
End Sub

--
Desert Piranha

------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=519047


--

Dave Peterson