Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filldown starting from F2 instead of F1 Ephraim Excel Worksheet Functions 5 April 15th 10 01:05 PM
Macro filldown SJC Excel Worksheet Functions 0 June 12th 08 06:31 PM
FillDown Macro Nick Junod Excel Worksheet Functions 3 February 6th 06 10:10 PM
Macro Filldown Hirsch Excel Worksheet Functions 4 June 6th 05 06:25 PM
FillDown Mike Fogleman Excel Programming 2 November 18th 03 10:46 PM


All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"