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
 

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

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:
 

Watch MrExcel Video

Forum statistics

Threads
1,123,076
Messages
5,599,627
Members
414,326
Latest member
kfg1287

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