json format data to vba variable

  • Hi

    I just needed to get value of of last_price value here it is 17028.9 from json in a variable

    {"status":"success","data": {"symbol_name":"amaz29MAR23F","trading_symbl":"amaz29MAR23F","company_name":"NIFTY","last_trade_time":"15:29:59","last_price":17028.9,"change":-149.25,"change_per":- 0.87,"last_quantity":50,"buy_quantity":220200,"sell_quantity":257350,"volume":11661400,"average_price":16968.33,"open":17099.8,"high":17109.8,"low":16866,"close":17178.15,"tick_size":0.05,"multiplier":0,"lot_size":50,"decimalprecision":0,"yearly_low_price":0,"yearly_high_price":0,"exchange":"NFO","token":"37834"}}

    Edited 2 times, last by Carim ().

  • Hi,


    With your string located in cell A1, you can test following formula:

    Code
    =MID(A1,FIND("last_price",A1)+12,FIND("change",A1)-2-FIND("last_price",A1)-12)+0

    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!