
Excel for mac vba code to get stock price how to#
I would really appreciate if you can teach me how to use normal formulas which we use on spreadsheet in VBA. I am sure the problem is with the way I have declared the formula for CurrentPrice.


Yesterday while learning how to define variables in VBA I was trying to experiment with this concept and came up with the following code which obviously doesn't work:- Sub Declaring_Variables()ĬurrentPrice = Formula ="=NUMBERVALUE(WEBSERVICE("/d/quotes.csv?s="&TickerName&"&f=l1")) I know the formula to extract the current stock price.įor Example: to find the current value of Netflix all you have to do in a spreadsheet is put "NFLX" in cell(A1) and in cell(A2) put the following formula: What I want it to do is ask the user what the Ticker Name is of the stock and once that is input, a message box should display the current price of the stock.

I am new to coding and programing and would appreciate any suggestions you can give me in creating my first real code.
