![]() |
need help in writing a statement
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 |
need help in writing a statement
To embed quotes inside the string, you must double them, i.e.
[b3] = "blp(""GE Equity"",""Last Price"") Else .... On Mon, 27 Sep 2004 18:05:57 -0400, susan hayes wrote: 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 |
need help in writing a statement
Double check your quotes. They don't all match up. You have 7 in total...
Probably a problem with "blp "susan hayes" wrote: 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 |
need help in writing a statement
Looks like I omitted the final quote. Should be
[b3] = "blp(""GE Equity"",""Last Price"")" Else .... On Mon, 27 Sep 2004 17:14:04 -0500, Myrna Larson wrote: To embed quotes inside the string, you must double them, i.e. [b3] = "blp(""GE Equity"",""Last Price"") Else .... On Mon, 27 Sep 2004 18:05:57 -0400, susan hayes wrote: 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 |
All times are GMT +1. The time now is 07:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com