Error 1004 using FormulaR1C1

Warship

Well-known Member
Joined
Jul 17, 2007
Messages
1,055
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
A case of cerebral flatulence most likely:

Both of the FormulaR1C1 lines are throwing Err1004.

Suggestions?

Code:
Sub TaxExempt()

    If ActiveSheet.Cells(ActiveCell.Row, 32) = "exempt" Then
        ActiveSheet.Range("AF" & ActiveCell.Row).FormulaR1C1 = "=IF(RC[-4]<>"",RC[-4]*GetTax(vFacID),"")"
        'ActiveSheet.Cells(ActiveCell.Row, 32).FormulaR1C1 = "=IF(RC[-4]<>"",RC[-4]*GetTax(vFacID),"")"
    Else
        ActiveCell = "exempt"
    End If
    
End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Embedded quotes get doubled, so the string should be:

"=IF(RC[-4]<>"""",RC[-4]*GetTax(vFacID),"""")"
 
Upvote 0
but of course! knew it was simple!
works now
thx Glenn!
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

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