Macro returns #value error

chrisk0420

New Member
Joined
May 5, 2011
Messages
6
I recorded a simple macro that pastes a formula into a cell. When I run it, it pastes the correct formula but it returns a #value error. If I go into the formula bar and hit enter it then works fine.

Is this an issue with my settings or with the macro itself.

Here is the macro

Sub Macro1()
'
' Macro1 Macro
'
'
Range("M9").Select
ActiveCell.FormulaR1C1 = "=ROR(R[-7]C[-10]:R[-6]C[-10],2)"
Range("M10").Select
End Sub
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Does this work?

Code:
Sub Macro1()
Range("M9").FormulaR1C1 = "=ROR(R[-7]C[-10]:R[-6]C[-10],2)"
End Sub
 
Upvote 0
what is the formula suppose to do?



what is the formula once it is pasted in M9?


Possibly use instead
Code:
Range("M9").Formula = "=ROR(C2:C3, 2)"
 
Last edited:
Upvote 0
Thanks... it works when not in R1C1 format. This was actually just a small part of a more complex macro, but I have now made adjustments so is is not R1C1 and it is fully functional

Thanks for the help
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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