need help in writing a statement

  • Thread starter Thread starter susan hayes
  • Start date Start date
S

susan hayes

I am trying the following using VBA:

If [b2] = 5 Then [b3] = "blp("GE Equity","Last Price") Else [b3] = ""

in writing this I get a Compile error with GE highlighted, with a
warning reading "Expected: end of statement."

I think its the ". . ." ". . . " quotations inside that are causing
the problem. Is there a way of writing, the following statement:

= blp("GE Equity","Last Price")

so it comes out (appears) in cell B3.

Thank you in advance


Susan
 
To embed quotes inside the string, you must double them, i.e.

[b3] = "blp(""GE Equity"",""Last Price"") Else ....
 
Double check your quotes. They don't all match up. You have 7 in total...
Probably a problem with "blp
 
Looks like I omitted the final quote. Should be

[b3] = "blp(""GE Equity"",""Last Price"")" Else ....


To embed quotes inside the string, you must double them, i.e.

[b3] = "blp(""GE Equity"",""Last Price"") Else ....


I am trying the following using VBA:

If [b2] = 5 Then [b3] = "blp("GE Equity","Last Price") Else [b3] = ""

in writing this I get a Compile error with GE highlighted, with a
warning reading "Expected: end of statement."

I think its the ". . ." ". . . " quotations inside that are causing
the problem. Is there a way of writing, the following statement:

= blp("GE Equity","Last Price")

so it comes out (appears) in cell B3.

Thank you in advance


Susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top