Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Autofill question

How do I modify the following statement so that it does
not have a specific range hard-coded ?

Selection.AutoFill Destination:=ActiveCell.Range
("A1:B2498")

I need it to be generic in nature so that it will copy the
formula from the active cells to all rows below where
there is a value in the cell to the left.

Thanks !!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Autofill question

Eric

try this:

ActiveCell.AutoFill _
Destination:=Range(ActiveCell, _
ActiveCell.Offset(0, -1).End(xlDown).Offset(0, 1))

Regards

Trevor


"Eric Dreshfield" wrote in message
...
How do I modify the following statement so that it does
not have a specific range hard-coded ?

Selection.AutoFill Destination:=ActiveCell.Range
("A1:B2498")

I need it to be generic in nature so that it will copy the
formula from the active cells to all rows below where
there is a value in the cell to the left.

Thanks !!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Autofill question

Trevor has supplied the code requested, but you don't really need a macro if this is all you are doing. The same operation can be
performed by selecting the cell to be copied and double clicking the Auto-Fill handle at the bottom right corner of the cell,

--

John Green - Excel MVP
Sydney
Australia


"Eric Dreshfield" wrote in message ...
How do I modify the following statement so that it does
not have a specific range hard-coded ?

Selection.AutoFill Destination:=ActiveCell.Range
("A1:B2498")

I need it to be generic in nature so that it will copy the
formula from the active cells to all rows below where
there is a value in the cell to the left.

Thanks !!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Autofill question

Thank you both for your reply....I knew about the double
click, but I am needing the macro to automate a process so
I will give the code that Trevor supplied a try.

Thanks for your help !
-----Original Message-----
Eric

try this:

ActiveCell.AutoFill _
Destination:=Range(ActiveCell, _
ActiveCell.Offset(0, -1).End

(xlDown).Offset(0, 1))

Regards

Trevor


"Eric Dreshfield" wrote in message
...
How do I modify the following statement so that it does
not have a specific range hard-coded ?

Selection.AutoFill Destination:=ActiveCell.Range
("A1:B2498")

I need it to be generic in nature so that it will copy

the
formula from the active cells to all rows below where
there is a value in the cell to the left.

Thanks !!



.

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
Autofill question I think... Robbro Excel Discussion (Misc queries) 0 April 22nd 10 04:00 PM
Autofill question Gor_yee Excel Discussion (Misc queries) 2 November 12th 09 10:53 PM
Autofill Question James8309 Excel Worksheet Functions 1 August 24th 08 11:03 AM
autofill question Ben H Excel Discussion (Misc queries) 0 March 2nd 05 03:37 PM
Autofill question lob Excel Worksheet Functions 2 February 17th 05 04:07 PM


All times are GMT +1. The time now is 12:41 AM.

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"