Am i being stupid :-)

asolanki

Board Regular
Joined
Jan 22, 2003
Messages
80
hi all

i have the following code :

Sheets("xxx").Select
ActiveSheet.Range("O2").Select
ActiveCell.FormulaR1C1 = _
"='AT68 Perm '!R[5]C[-13] & ""-"" & 'AT68 Perm '!R[6]C[-13]"
ActiveSheet.Range("O3").Select
ActiveCell.FormulaR1C1 = "=R[-1]C"
ActiveSheet.Range("O3").Select
Selection.AutoFill Destination:=Range("O3:O22"), Type:=xlFillDefault
ActiveSheet.Range("O3:O22").Select

I keep getting the following error on the Selction statement:
autofill method of range class failed

I cant for the life of me find a reason why I am getting the error, i know im doing something really stupid..can someone help

Thanks in advance

Ash
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

anvil19

Board Regular
Joined
Nov 18, 2003
Messages
230
Hey Ash

See my arrow below :

Code:
Sheets("xxx").Select 
ActiveSheet.Range("O2").Select 
ActiveCell.FormulaR1C1 = _   '<--- 2x = signes here!
"='AT68 Perm '!R[5]C[-13] & ""-"" & 'AT68 Perm '!R[6]C[-13]" 
ActiveSheet.Range("O3").Select 
ActiveCell.FormulaR1C1 = "=R[-1]C" 
ActiveSheet.Range("O3").Select 
Selection.AutoFill Destination:=Range("O3:O22"), Type:=xlFillDefault 
ActiveSheet.Range("O3:O22").Select

I don't know if that's it, but start there.


anvil19
:eek:
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,034
Messages
5,856,953
Members
431,841
Latest member
jaybeem

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top