First of all, sorry but English is not my 1st language, lol
I'm a stock broker and I use a lot of excel for registers (but I'm very newbie in Excel, very).
So I've downloaded an DDE Server to get stock prices for me.
I can get an Stock price using:
What I want to do is put a column with stock codes and on the right the stock price. But I can't figure out the syntax to get the stock code on another cell.=TZMS|STOCK!ULT
I want something like:
To get the stock price for the code in cell A21.=TZMS|A21!ULT
How can I do that?
Thanks everyone
EDIT:
I looked a lot in Internet and found this macro that changes the formula of any cell to hide the errors like "#DIV/0":
Maybe someone who know VBA can adapt for me?Sub Remove_Formula_Errors()
Dim rng As Range, cell As Range, fmla As String
Set rng = Cells.SpecialCells(xlCellTypeFormulas, 16)
For Each cell In rng
fmla = Right(cell.Formula, Len(cell.Formula) - 1)
cell.Formula = "=if(iserror(" & fmla & "), """"," & fmla & ")"
Next
End Sub
The logic I need is:
- Search cells with value "=TZMS|STOCK!ULT"
- Replace "STOCK" with left cell's text
Thanks
Bookmarks