Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping Autofill at alst line of file
I use the code below to autofill columns,(using formulas), which is done successfully except that it creates garbage past the last line of the file. Range("V2:AF2").AutoFill Destination:=Range("V2", Range("AF2").End(xlDown)(0)) How can I stop it doing this to row 65536? Thanks -- leskoby ------------------------------------------------------------------------ leskoby's Profile: http://www.excelforum.com/member.php...o&userid=26616 View this thread: http://www.excelforum.com/showthread...hreadid=399956 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping Autofill at alst line of file
leskoby There are several ways to do this. Here is one way This finds last row with data in it then autofills down to that row Dim GetBottomRow As Long GetBottomRow = Cells.Find(what:="*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row Range("v2:af2").AutoFill Destination:= _ Range("v2:af" & GetBottomRow), Type:=xlFillDefault -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=399956 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping Autofill at alst line of file
Thanks Mudraker, worked like a charm. -- leskoby ------------------------------------------------------------------------ leskoby's Profile: http://www.excelforum.com/member.php...o&userid=26616 View this thread: http://www.excelforum.com/showthread...hreadid=399956 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Graphing: Stopping the downvard line | Excel Worksheet Functions | |||
Starting and Stopping excel from command line. | Excel Discussion (Misc queries) | |||
Stopping chart line where 1 of 2 columns of data in calculation is blank | Charts and Charting in Excel | |||
Stopping Date Autofill in Chart Wizard | Excel Discussion (Misc queries) | |||
Reads entire *.txt file into string opposed to a desired line by line input. | Excel Programming |