Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This there anyway to write code for the autofill function that allows you to choose a specific number of cells to fill instead of having to enter the range of cells? In other words, instead of writing: Selection.AutoFill Destination:=Range("H21:K21"), Type:=xlFillDefault Is it possible to write something that says autofill the 5 cells below the cell that has been selected? Any help is greatly appreciated. Thanks, Peter -- PGalla06 ------------------------------------------------------------------------ PGalla06's Profile: http://www.excelforum.com/member.php...o&userid=24260 View this thread: http://www.excelforum.com/showthread...hreadid=381649 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Give this a try Peter. Sub Autofil() Dim CurRow As Long CurRow = Selection.Row Selection.AutoFill Destination:=Range("H" & CurRow & ":K" & CurRow + 5), Type:=xlFillDefault End Sub For this example you will need to have a range from H - K selected and it will autofill the next 5 cells. HTH -- bhofsetz ------------------------------------------------------------------------ bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807 View this thread: http://www.excelforum.com/showthread...hreadid=381649 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Autofill Function | Excel Discussion (Misc queries) | |||
No autofill VLookup function | Excel Worksheet Functions | |||
Using the autofill function but increment by certain number in function | Excel Worksheet Functions | |||
INDIRECT Function and Autofill | Excel Worksheet Functions | |||
Autofill & Lookup Function | Excel Programming |