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

Excellent! Thanks for all the help

"Ken Loomis" wrote:

Thanks for the "no need to select" tip, Myrna.

That helps me a lot.

Ken Loomis


"Myrna Larson" wrote in message
...
You should be able to accomplish the same thing without selecting things,
which slows the macro down:

TotalRows = ActiveSheet.UsedRange.Rows.Count
Range("B3",Range("B3").Offset(TotalRows - 2,1)).FillDown

or, if I have the math right

TotalRows = ActiveSheet.UsedRange.Rows.Count
Range("B3").Resize(TotalRows - 2, 2).FillDown


On Mon, 4 Oct 2004 19:14:06 -0700, "Ken Loomis"
wrote:

I am pretty new at this stuff, but I was able to do that with something
like
this:

totalrows = ActiveSheet.UsedRange.Rows.count
Range("B3").Select
Range(ActiveCell, ActiveCell.Offset(totalrows - 2,
1).Range("A1")).Select
Selection.FillDown

I have to admit I do not understand why this was needed Range("A1") in
that
3rd line. But it works great no matter how many rows are in the sheet.

But I do know that the Offset(totalrows - 2, 1).tells VBA to select
everything from the current selection down to the last row and over one
column.

Hope this helps.

Ken Loomis

"Jason" wrote in message
...
I need help with the autofill file. I am using some code to autofill to
copy
down formulas to the last empty row. The problem I have is that the
last
row
is dynamic and may change, which I do not know how to account for. My
code
is as follows:

Range("B3:C3").Select
Selection.AutoFill Destination:=Range("B3:C12")

C12 will not always be the last row. I want the code to look to column
A
to
where the last cell with data is, and filldown B3:C3 down to this point.
How
can I adjust the "Destination" part of the code to allow this. 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 [email protected] Excel Worksheet Functions 3 November 7th 08 07:53 AM
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: 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:34 PM.

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"