Help with Long formula in VBA in one line

NeelsBorstlap

New Member
Joined
Jul 23, 2010
Messages
25
Hi - Need help with this long formula in my code - How (where) do I enter a " _" and then hit enter to keep the code nice under each other and not in 'n long line????

I tried everything but VBA give me a " Compile error: Expected: list separator or )" and I do not know what it means.

ActiveCell.FormulaR1C1 = _
"=IF(ISNUMBER(SEARCH(""loan"",RC[-2])), ""Cash Loan"" , IF(ISNUMBER(SEARCH(""Proleen Balance"",RC[-2])), ""Cash from Proloan"" , IF(ISNUMBER(SEARCH(""cash receipt -client"",RC[-2])), ""Cash Payment"",IF(ISNUMBER(SEARCH(""337"",RC[-5])), ""Exp Fuel Generator"",IF(ISNUMBER(SEARCH(""331"",RC[-5])), ""Exp Printing and Stationary"",IF(ISNUMBER(SEARCH(""332"",RC[-5])), ""Exp Refund CL Proloan"",IF(ISNUMBER(SEARCH(""333"",RC[-5])), ""Exp Groceries"", """")))))))"

Thanks.

Neels:unsure:
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
VBA Code:
    ActiveCell.FormulaR1C1 = _
        "=IF(ISNUMBER(SEARCH(""loan"",RC[-2])), ""Cash Loan"" , " & _
        "IF(ISNUMBER(SEARCH(""Proleen Balance"",RC[-2])), ""Cash from Proloan"" , " & _
        "IF(ISNUMBER(SEARCH(""cash receipt -client"",RC[-2])), ""Cash Payment""," & _
        "IF(ISNUMBER(SEARCH(""337"",RC[-5])), ""Exp Fuel Generator""," & _
        "IF(ISNUMBER(SEARCH(""331"",RC[-5])), ""Exp Printing and Stationary""," & _
        "IF(ISNUMBER(SEARCH(""332"",RC[-5])), ""Exp Refund CL Proloan""," & _
        "IF(ISNUMBER(SEARCH(""333"",RC[-5])), ""Exp Groceries"", """")))))))"
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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