ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   reference to a cell within a string (https://www.excelbanter.com/excel-programming/311804-reference-cell-within-string.html)

susan hayes

reference to a cell within a string
 
I have written the following:

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

giving me the wanted result: blp("GE Equity","Last Price")

My question is, lets say I would like to reference cell [b4] = IBM, in
order to replace GE in this string.

to give me the result: blp("IBM Equity","Last Price")

Thank you,

Susan


K Dales[_2_]

reference to a cell within a string
 
If [b2] = 5 Then [b3] = "blp(""" & "[b4] & " Equity"",""Last Price"")"

"susan hayes" wrote:

I have written the following:

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

giving me the wanted result: blp("GE Equity","Last Price")

My question is, lets say I would like to reference cell [b4] = IBM, in
order to replace GE in this string.

to give me the result: blp("IBM Equity","Last Price")

Thank you,

Susan



K Dales[_2_]

reference to a cell within a string
 
Yikes! Just noticed a typo.
should be:
"blp(""" & [b4] & " Equity"",""Last Price"")"

"K Dales" wrote:

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

"susan hayes" wrote:

I have written the following:

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

giving me the wanted result: blp("GE Equity","Last Price")

My question is, lets say I would like to reference cell [b4] = IBM, in
order to replace GE in this string.

to give me the result: blp("IBM Equity","Last Price")

Thank you,

Susan



sulprobil

reference to a cell within a string [Bloomberg lookup]
 
Have a look at
http://www.sulprobil.com/html/early_warning_system.html

But I think now it is better to use ActiveX than bpl()
functions.

Kind regards,
sulprobil


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com