Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofill range
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofill range
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" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofill range
Thanks Chip thats just what I needed.
Wendy "Chip Pearson" wrote in message ... 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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill down without range | Excel Programming | |||
AutoFill a Range | Excel Programming | |||
AUTOFILL with specific range | Excel Programming | |||
autofill range | Excel Programming | |||
autofill with dynamic range again | Excel Programming |