Re: VBA auto fill problems

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dave Peterson (ec35720_at_msn.com)
Date: 09/28/04


Date: Mon, 27 Sep 2004 19:31:10 -0500

If you ever had anything in row 1, then Active***.UsedRange.Rows.Count will
give you the last row that's been used.

If you hit ctrl-end in xl, it'll be that row.

Heath wrote:
>
> Thank you very much. This did the trick. I have one question though. What
> am I telling the program to do when I give it the "&
> Active***.UsedRange.Rows.Count" command?
>
> "bdcrisp" wrote:
>
> >
> > Modify the bottom of your code
> >
> > "=IF(COUNTIF(R1C2:R[-1]C[-1],"">0"")>=R1C4,AVERAGE(OFFSET(R[-1]C[-1],0,0,-R1C4)),"""")"
> > Range("C2").Select
> > Selection.AutoFill Destination:=Range("C2:C" &
> > Active***.UsedRange.Rows.Count)
> > End Sub
> >
> > 'This will fill to the maximum number of used rows on the ***.
> >
> > 'Let me know how that works out for you
> >
> >
> > --
> > bdcrisp
> >
> >
> > ------------------------------------------------------------------------
> > bdcrisp's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3564
> > View this thread: http://www.excelforum.com/showthread.php?threadid=262963
> >
> >

-- 
Dave Peterson
ec35720@msn.com

Quantcast