Sub Get1Call()
'Run from Sheet Module!
'Get Call Letters and Last Quote.
Dim xmlhttp, QuoteP$, QuoteN$, myDT$, n1%
Dim MessageC, TitleC, DefaultC, MyCall
MessageC = "Enter your stocks Call Letters Below:" 'Set prompt.
TitleC = "Get Call Letters!" 'Set title.
DefaultC = "AMD" 'Set default.
'Display message, title, and default value.
MyCall = InputBox(MessageC, TitleC, DefaultC)
'Create the XML document type reference.
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
'Open a connection to the server and get call letters info.
strURL = "http://finance.yahoo.com/q?s=" & MyCall & "&d=t"
'http://finance.yahoo.com/q?s=IBM&d=t
xmlhttp.Open "GET", strURL, False, "", ""
'Send for the information needed!
xmlhttp.Send
'Return the html code page information for the call letters used.
RtnPage = xmlhttp.ResponseText
'If call letters are missing: get the next set or exit!
On Error GoTo myEnd
'If the lay-out of the web page is changed you must update the search below!
'Find the "Last Trade:" label on the web page for the current set of call letters:
myStartPS = InStr(RtnPage, "Last Trade:")
myStartPF = InStr(RtnPage, "Trade Time:")
myFinP = (myStartPF - 116) - myStartPS
'Test helper!
'MsgBox myStartPS & vbCr & myStartPF & vbCr & myFinP
myStartNS = InStr(RtnPage, "Summary for ")
myStartNF = InStr(RtnPage, "- Yahoo! Finance") - 109
'Test helper!
'MsgBox myStartP & vbCr & myStartNS & vbCr & myStartNF
'The Ticker value is "52" characters right of the found label.
myDatStartP = myStartPS + 52
myDatStartN = myStartNS + 12
'Get the actual text value from the web page!
QuoteP = Mid(RtnPage, myDatStartP, myFinP)
'QuoteP1 = Mid(RtnPage, myDatStartP, 1850)
QuoteN = Mid(RtnPage, myDatStartN, myStartNF)
'Get Time and date!
myDT = Format(Time, "Medium Time") & " on: " & Format(Date, "General Date")
'Show Ticker message!
myTicker = MsgBox(Prompt:=myDT & vbCr & vbCr & MyCall & " ==> " & _
QuoteP & vbCr & vbCr & QuoteN, Title:="Ticker!")
myEnd:
End Sub