Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 - Autofill & VBA

Status
Not open for further replies.

Binnit

Technical User
Apr 28, 2004
627
US
Hopefully a simple answer here....

When double clicking on a worksheet cell the formula is copied down where the adjacent left cell is not empty, once it finds an empty cell it stops.

I have recorded this event in a macro:-
Code:
Range("F3").Select
    Selection.AutoFill Destination:=Range("F3:F710")

As you can see it has completed the range destination "F710" which was fine for this particular case.

What I need to find is the VBA dynamic equivilant of the "destination" cell so that when the macro is run it copies down until it gets to the first empty adjacent cell (the same action as the double click).

Any suggestions?




Happiness is...not getting what you want but wanting what you have already got
 
firstly look at range in the vba help files,

also have a look at thread707-1400305



Chance,

F, G + H
 
Thanks Chance for the helpful directions to xlbo's post which did the trick, I will do the needful and provide him with a star.....

Happiness is...not getting what you want but wanting what you have already got
 



Give xlbo's FAQ a vote.

Skip,

[glasses] When a wee mystic is on the loose..
It's a Small Medium at Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top