View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Where am I going wrong? (losing the variable because of need for quotation marks)

Activecell.Formula = "=BDH(""stVar"",""PX Last"",""1/1/1900"",blptoday())"

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Mark Stephens" wrote in message
...
Hi guys,

Nice to be back after many years in the wilderness:)


I have a sub which places this formula in a cell:

=BDH("stVar","PX Last","1/1/1900",blptoday())

stVar is a variable taken from a column of tickers in another sheet
stepping through them one at a time.

the issue I have is that the formula has to appear as above with the
quatation marks and as soon as I start enclosing quatation marks in
quotation marks the code gets totally confused (understandably). Does
anyone know what to do in such circumstances, i am sure there is a well
known workaround but I have been away from programming for a number of
years now and am rather rusty, so any help will be much appreciated.

Thanks in advance, Mark