PC Review


Reply
Thread Tools Rate Thread

Autofill range

 
 
Wendy
Guest
Posts: n/a
 
      7th Dec 2006
Hi

I'm trying to autofill a column using Selection.AutoFill Destination:=
Range(A1, rowcounter)

where rowcounter = Application.Sheets(2).Range("G1").value
G1 is =CountA(A:A)

The rowcounter has the correct rownumber in it but the auto fill fails with
Method 'Range' of object '_global' failed

What I am doing is using a formula to put the contents of column B with some
additions into column A. It works using
Selection.AutoFill Destination:=
ActiveCell.Range(Selection,Selection.End(x1Down)), Type:=_
x1FillValues
but it fills down to 65536 there are only 1210 rows of data this time.

Thanks

Wendy


 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      7th Dec 2006
Try something like

Dim RowCounter As Long
RowCounter = Range("G1").Value
Selection.AutoFill Destination:=Range(Range("A1"), Cells(RowCounter, "A"))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Wendy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I'm trying to autofill a column using Selection.AutoFill Destination:=
> Range(A1, rowcounter)
>
> where rowcounter = Application.Sheets(2).Range("G1").value
> G1 is =CountA(A:A)
>
> The rowcounter has the correct rownumber in it but the auto fill fails
> with
> Method 'Range' of object '_global' failed
>
> What I am doing is using a formula to put the contents of column B with
> some
> additions into column A. It works using
> Selection.AutoFill Destination:=
> ActiveCell.Range(Selection,Selection.End(x1Down)), Type:=_
> x1FillValues
> but it fills down to 65536 there are only 1210 rows of data this time.
>
> Thanks
>
> Wendy
>
>



 
Reply With Quote
 
Wendy
Guest
Posts: n/a
 
      8th Dec 2006
Thanks Chip thats just what I needed.

Wendy

"Chip Pearson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Try something like
>
> Dim RowCounter As Long
> RowCounter = Range("G1").Value
> Selection.AutoFill Destination:=Range(Range("A1"), Cells(RowCounter, "A"))
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
> (email address is on the web site)
>
>
> "Wendy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi
> >
> > I'm trying to autofill a column using Selection.AutoFill Destination:=
> > Range(A1, rowcounter)
> >
> > where rowcounter = Application.Sheets(2).Range("G1").value
> > G1 is =CountA(A:A)
> >
> > The rowcounter has the correct rownumber in it but the auto fill fails
> > with
> > Method 'Range' of object '_global' failed
> >
> > What I am doing is using a formula to put the contents of column B with
> > some
> > additions into column A. It works using
> > Selection.AutoFill Destination:=
> > ActiveCell.Range(Selection,Selection.End(x1Down)), Type:=_
> > x1FillValues
> > but it fills down to 65536 there are only 1210 rows of data this time.
> >
> > Thanks
> >
> > Wendy
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill down without range cbh35711 Microsoft Excel Programming 0 29th Mar 2006 11:31 PM
AutoFill a Range =?Utf-8?B?U3RldmUgQw==?= Microsoft Excel Programming 3 22nd Nov 2005 04:10 PM
Variable Autofill range Kate Microsoft Excel Programming 2 23rd Feb 2004 09:20 PM
Variable Autofill Range Kate Microsoft Excel Programming 1 23rd Feb 2004 09:12 PM
autofill range Stephen Microsoft Excel Programming 6 24th Dec 2003 12:57 AM


Features
 

Advertising
 

Newsgroups
 


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