If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > VBA Recorder not transcribing excel formula correctly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 1
VBA Recorder not transcribing excel formula correctly

I am very new at this who VBA language. For that reason i have become best freinds with the recorder. Below is the Excel formula which works perfectly when pasted into cell.

=IF(OR(R3="On Hold",R3="Expired")*AND(OR(J3="Approved",J3="No DM Req")),"3 DM Approved",IF(OR(J3="Approved",J3="No DM Req",J3="New License Order")*AND(P3="Approved")*AND(R3="Executable Released"),"1 Executable Released",IF(OR(J3="Approved",J3="No DM Req",J3="New License Order")*AND(NOT(R3="Executable Released"))*AND(ISBLANK(N3)=FALSE),"2 DM Approved & DB Needs Approval",IF(OR(J3="Approved",J3="No DM Req")*AND(NOT(R3="Executable Released"))*AND(ISBLANK(N3)=TRUE),"3 DM Approved",IF(OR(J3="Rejected",J3="With Sales",J3="With WW Bus Ops",J3="With VP of Finance"),"4 DM Needs Approval",IF(OR(J3="New License Order",ISTEXT(J3)=FALSE),"5 Non Workflow","try again"))))))

Here is the VBA translation which returns an error.

ActiveCell.FormulaR1C1 = _
"=IF(OR(RC[-10]=""On Hold"",RC[-10]=""Expired"")*AND(OR(RC[-18]=""Approved"",RC[-18]=""No DM Req"")),""3 DM Approved"",IF(OR(RC[-18]=""Approved"",RC[-18]=""No DM Req"",RC[-18]=""New License Order"")*AND(RC[-12]=""Approved"")*AND(RC[-10]=""Executable Released""),""1 Executable Released"",IF(OR(RC[-18]=""Approved"",RC[-18]=""No DM Req"",RC[-18]=""New License Order"")*A"& _
"C[-10]=""Executable Released""))*AND(ISBLANK(RC[-14])=FALSE),""2 DM Approved & DB Needs Approval"",IF(OR(RC[-18]=""Approved"",RC[-18]=""No DM Req"")*AND(NOT(RC[-10]=""Executable Released""))*AND(ISBLANK(RC[-14])=TRUE),""3 DM Approved"",IF(OR(RC[-18]=""Rejected"",RC[-18]=""With Sales"",RC[-18]=""With WW Bus Ops"",RC[-18]=""With VP of Finance""),""4 DM Needs Approval""& _
"C[-18]=""New License Order"",ISTEXT(RC[-18])=FALSE),""5 Non Workflow"",""try again""))))))"
Range("AB4").Select

I know its complicated. I hope its something really simple. First post hopefully someone can help.

Thanks,

PattyColbs
Reply With Quote
Reply

Tags
excel, first post, formulas, vba

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On