Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
filldown macro
Have the following code, by recording the macro:
ActiveCell.Offset(0, -1).Range("A1:B1").Select ActiveCell.Offset(0, 1).Activate Range(Selection, Selection.End(xlDown)).Select ActiveCell.Offset(0, -1).Range("A1:B16").Select ActiveCell.Activate Selection.FillDown Am trying to: 1) get one cell to grab itself and the one to its immediate left 2) ctrl+shft+down on the first cell's (not the one it grabs) column 3) take one row less than the stretchdown length 4) fill down Problem is twofold... 1) highlight area is taking column A:B, instead of B:C (assume C is where I started and where I want to go one immediate left from) 2) haven't gotten there, but seems like the relativity of the stretchdown is only good through finding the next value, but then is set at 16 rows. The 16 rows may vary, so I need it to actually count the number of rows in the highlight area and take that minus 1 as the length of the highlight area. any suggestions on tweaks are appreciated. -- Boris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
filldown macro
Sub CopyFill()
Dim cell As Range Set cell = Selection.Offset(0, -1).Resize(1, 2) With cell With Range(cell, .End(xlDown).Offset(-1, 0)) .FillDown End With End With End Sub "BorisS" wrote: Have the following code, by recording the macro: ActiveCell.Offset(0, -1).Range("A1:B1").Select ActiveCell.Offset(0, 1).Activate Range(Selection, Selection.End(xlDown)).Select ActiveCell.Offset(0, -1).Range("A1:B16").Select ActiveCell.Activate Selection.FillDown Am trying to: 1) get one cell to grab itself and the one to its immediate left 2) ctrl+shft+down on the first cell's (not the one it grabs) column 3) take one row less than the stretchdown length 4) fill down Problem is twofold... 1) highlight area is taking column A:B, instead of B:C (assume C is where I started and where I want to go one immediate left from) 2) haven't gotten there, but seems like the relativity of the stretchdown is only good through finding the next value, but then is set at 16 rows. The 16 rows may vary, so I need it to actually count the number of rows in the highlight area and take that minus 1 as the length of the highlight area. any suggestions on tweaks are appreciated. -- Boris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filldown starting from F2 instead of F1 | Excel Worksheet Functions | |||
Macro filldown | Excel Worksheet Functions | |||
FillDown Macro | Excel Worksheet Functions | |||
Macro Filldown | Excel Worksheet Functions | |||
FillDown | Excel Programming |