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!

VB in Excel -copying a formula down

Status
Not open for further replies.

DanAuber

IS-IT--Management
Apr 28, 2000
255
FR
When in Excel - if you are in a certain cell, and you double click in the right hand lower corner of the cell(when you get a black cross) - it copies the formula in the cell down until it gets to a blank cell in the columns either side.

This is very useful functionality - is there an Excel VBA macro command I can use to get this to happen within my macro ?

Thanks for any help

Dan

 


Hi,

You have to define the range and use PasteSpecial - Formulas...
Code:
Range1.Copy
Range2.PasteSpecial xlFormulas
Check out the End range method, CurrentRegion, UsedRange. It all depends on the geometry of your data area -- is your data area contiguous, etc?



Skip,

[glasses] [red][/red]
[tongue]
 
Have a look at the AutoFill method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top