Thread: filldown macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BorisS BorisS is offline
external usenet poster
 
Posts: 191
Default 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