R1C1 formula 1004 error

Mpotten

New Member
Joined
Apr 2, 2015
Messages
12
HI Brains trust

I have an issue in that when trying to insert a formula into my table i get a 1004 error and bumped in to debug mode.

the following code is from the macro I am working on. code in green is working but code in red does not work.



LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("M2:M" & LastRow).FormulaR1C1 = "=sum(RC[1]/RC[-1])"


Columns("M:N").NumberFormat = "_-[$$-C09]* #,##0.00_-;-[$$-C09]* #,##0.00_-;_-[$$-C09]* ""-""??_-;_-@_-"


LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("H2:H" & LastRow).FormulaR1C1 = "=trim(right(RC[-1],3)"
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Your formula is missing a right parenthesis.

Code:
Range("H2:H" & LastRow).FormulaR1C1 = "=trim(right(RC[-1],3)[COLOR=#FF0000])[/COLOR]

Also I recommend using CODE tags.
 
Last edited:
Upvote 0
typical I was staring at that for ages and could not work it out.

appreciate your help thanks
 
Last edited:
Upvote 0
My answer was missing a close quote :oops:

Code:
Range("H2:H" & LastRow).FormulaR1C1 = "=trim(right(RC[-1],3)[COLOR=#FF0000])"[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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