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


How would I make autofill work in a macro without having to explicitl
specify the range of cells I want to fill? I have a sheet in which th
number of rows changes all the time, and I need to autofill equations a
the beginning of two columns

--
carg
-----------------------------------------------------------------------
carg1's Profile: http://www.excelforum.com/member.php...fo&userid=1527
View this thread: http://www.excelforum.com/showthread.php?threadid=27317

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofill

Where to look to find the number of rows? Which columns.

--
Regards,
Tom Ogilvy

"carg1" wrote in message
...

How would I make autofill work in a macro without having to explicitly
specify the range of cells I want to fill? I have a sheet in which the
number of rows changes all the time, and I need to autofill equations at
the beginning of two columns.


--
carg1
------------------------------------------------------------------------
carg1's Profile:

http://www.excelforum.com/member.php...o&userid=15271
View this thread: http://www.excelforum.com/showthread...hreadid=273174



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

This assumes that column 1 contains all the rows that need the formula
applied to and cell H1 contains the initial formula. Duplicate the copy/paste
process for multiple, non-adjacent columns. For adjacent columns, you could
"resize" the copy (".Resize(1, 2)").

Sub procFillFormulas()
Cells(1, 8).Copy
Range(Cells(2, 8), Cells(Cells(Rows.Count, 1).End(xlUp).Row,
8)).PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
End Sub

Dale Preuss

"carg1" wrote:


How would I make autofill work in a macro without having to explicitly
specify the range of cells I want to fill? I have a sheet in which the
number of rows changes all the time, and I need to autofill equations at
the beginning of two columns.


--
carg1
------------------------------------------------------------------------
carg1's Profile: http://www.excelforum.com/member.php...o&userid=15271
View this thread: http://www.excelforum.com/showthread...hreadid=273174


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
Can autofill do this? CluelessGuy vs. Windows Excel Discussion (Misc queries) 2 February 8th 07 10:29 PM
Autofill paulinoluciano Excel Worksheet Functions 8 December 28th 05 06:00 PM
Autofill? Amateur Excel Discussion (Misc queries) 3 September 9th 05 07:46 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM


All times are GMT +1. The time now is 05:53 AM.

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

About Us

"It's about Microsoft Excel"