View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default AutoFill using a macro

This is one way to fill down the selection based on the column to the left:

With Selection
Range(.Offset(0, -1), .Offset(0, -1).End(xlDown)).Offset(0,
1).FillDown
End With


--
Jim
"katamy" wrote in message
...
| Im working in Excel 2003. I have a report which runs in another program
that
| I save in Excel. I then create a macro to insert columns at various places
| and perform a vlookup. The data varies each time the report is run. I know
| there is a code that will allow me to AutoFill down to the last row of
that
| column, but I cant remember how to do it. Any suggestions?
|
| Here is the code€¦
|
| Range("X2").Select
| ActiveCell.FormulaR1C1 = _
| "=VLOOKUP(RC[-1],'[Look up Vince
report.xls]Function'!C1:C2,2,FALSE)"
| Selection.AutoFill Destination:=Range("X2:X2649")
| Range("X2:X2649").Select
|
| Thanks in advance for your help!