Line number or label or statement lỗi gì left vba năm 2024

\=IF(OR(RC[-5]="Default to MIP pricing",RC[-5]="Not Traded"),"Not Traded",IF(RC[2]="IG",IF(AND(OR(RC[-5]="Priced to Maturity",RC[-5]="Priced to Call"),RC[-21]<>R1C3),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps adjusted to "&MROUND(RC[-9],1)&"bps based on "&IF(AND(RC[-12]<>"",ABS(RC[-12])<0.1),"CDS change of "&MROUND(ABS(RC[-12]*100),0.01)*SIGN(RC[-12])&"%","LUCI change of "&MROUND(ABS(RC[-11]*100),0.01)*SIGN(RC[-11])&"%"),IF(AND(OR(RC[-5]="Using Trade PX",RC[-21]=R1C3),ISERROR("TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps")),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps")),IF(RC[-21]>R5C3,"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" adjusted by HY index change of "&MROUND(ABS(RC[-11]*100),0.01)*SIGN(RC[-11])&"%")))

Hopefully you can help!

mySQL = "INSERT INTO tblUnbilled_BegMonth_ExcludedData ([Billing Status],[LOB], [Area Head Name], [Dept Head Name],"
mySQL = mySQL & "[Division Head Name], [Unit Head Name], [Manager #], [Manager Name], [Customer Id], [Customer Name],"
mySQL = mySQL & "[Fund], [CBS Id], [Fund Name], [Fund Type], [Cycle], [Billing Frequency], [Billing Month],"
mySQL = mySQL & "[Accrual Est], [Last Billed -1], [Last Billed -2], [Last Billed -3], [Date Modified])" & _
"SELECT (tblUnbilled_BegMonth_CleanData.[Billing Status], tblUnbilled_BegMonth_CleanData.[LOB],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Area Head Name], tblUnbilled_BegMonth_CleanData.[Dept Head Name],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Division Head Name], tblUnbilled_BegMonth_CleanData.[Unit Head Name],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Manager #], tblUnbilled_BegMonth_CleanData.[Manager Name],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Customer Id], tblUnbilled_BegMonth_CleanData.[Customer Name],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Fund], tblUnbilled_BegMonth_CleanData.[CBS Id],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Accrual Est], tblUnbilled_BegMonth_CleanData.[Fund Name],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Fund Type], tblUnbilled_BegMonth_CleanData.[Cycle],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Billing Frequency], tblUnbilled_BegMonth_CleanData.[Billing Month],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Accrual Est], tblUnbilled_BegMonth_CleanData.[Last Billed -1],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Last Billed -2], tblUnbilled_BegMonth_CleanData.[Last Billed -3],"
mySQL = mySQL & "tblUnbilled_BegMonth_CleanData.[Date Modified])" & _
" FROM tblUnbilled_BegMonth_CleanData" & _
" WHERE (((tblUnbilled_BegMonth_CleanData.[Billing Month])> '" & crntCBSUnbilledCycle & "'));"

I would expect to see 123 displayed following the call to the function, instead I am getting the error message above. Any ideas? Could there be a permissions / setup problem?

Thanks!

PS using MS Office Standard 2013

Last edited by forrest; 12-06-2015 at 04:35 PM.Reason: added version of MS Office

  • 12-06-2015, 05:12 PM Found the problem .... It was the way I was testing the function in the immediate window. The proper way to test a function from the immediate window is with a question mark (?) and not an equal sign (=) Your code works fine here once I replace the smart quotes around your file paths with regular quotes.
  • kamran1015 Welcome to the Forum Please start your own post. Posting in another member's Thread is known as hijacking and is not allowed here. By all means add a link to a Thread that may be related to your question. kamran1015 Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.