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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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:
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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
Back
Top