Create an excel function that downloads one historical data point from Google Finance

The below code needs to be adjusted into a VBA function - that has three arguments: Ticker, Date, Type, where Type can be: Open, High, Low, Close or Volume. When used in excel in a cell it should return the corresponding value as per Google Finance website (this will be a number or if not available "N/A").

At the moment the code below is used for downloading the full data (type + date range), however the function should be referring to just one value.


Option Explicit

Sub GetData()

Dim DataSheet As Worksheet

Dim EndDate As Date

Dim StartDate As Date

Dim Symbol As String

Dim qurl As String

Dim nQuery As Name

Dim LastRow As Integer

[url removed, login to view] = False

[url removed, login to view] = False

[url removed, login to view] = xlCalculationManual

Sheets("Data").[url removed, login to view]

Set DataSheet = ActiveSheet

StartDate = [url removed, login to view]("startDate").Value

EndDate = [url removed, login to view]("endDate").Value

Symbol = [url removed, login to view]("ticker").Value

Sheets("Data").Range("a1").[url removed, login to view]

qurl = "[url removed, login to view]" & Symbol

qurl = qurl & "&startdate=" & MonthName(Month(StartDate), True) & _

"+" & Day(StartDate) & "+" & Year(StartDate) & _

"&enddate=" & MonthName(Month(EndDate), True) & _

"+" & Day(EndDate) & "+" & Year(EndDate) & "&output=csv"


With Sheets("Data").[url removed, login to view](Connection:="URL;" & qurl, Destination:=Sheets("Data").Range("a1"))

.BackgroundQuery = True

.TablesOnlyFromHTML = False

.Refresh BackgroundQuery:=False

.SaveData = True

End With

Sheets("Data").Range("a1").[url removed, login to view] Destination:=Sheets("Data").Range("a1"), DataType:=xlDelimited, _

TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _

Semicolon:=False, Comma:=True, Space:=False, other:=False

Sheets("Data").Columns("A:G").ColumnWidth = 12

End Sub

Beceriler: Excel, VB.NET

Daha fazlasını gör: number function, function number, create symbol, g finance, create space.com, semicolon, finance in excel, finance excel, finance excel data, excel function, excel finance, excel calculation, downloading data, data point, create excel worksheet, create an excel, volume calculation, vba function, downloads application, create application excel

İşveren Hakkında:
( 5 değerlendirme ) Den Haag, Netherlands

Proje NO: #7431834



I have an Excel function ready for this. I created a demo and you can see it at [login to view URL]

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(23 Değerlendirme)

Bu iş için 11 freelancer ortalamada $45 teklif veriyor


Please send me the actual file so I can see the given parameters on the Data sheet. ............................................................................

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(250 Değerlendirme)

Hi Sir/Madam. Ready to start. Thanks ..............................................................................................

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(30 Değerlendirme)

Hey There, Thanks for posting the project. Its looks feasible and am Interested to do it. Next steps: Lets discuss/validate the complete requirement and I can start to get this done with required quality ou Daha Fazla

in %bids___i_period_sub_35% gün içinde55%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(138 Değerlendirme)

Hi there, I have a vast experience in Excel and VBA and would be happy to help you on the project. Best regards, Eugene

in %bids___i_period_sub_35% gün içinde15%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(233 Değerlendirme)

Hi, I have more than 14 years of Excel/VBA exp and I am expert in this kind of work. I have completed more than 225 projects. Please look at the feedback left by my employers to know more about my work. Wai Daha Fazla

in %bids___i_period_sub_35% gün içinde30%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(121 Değerlendirme)

I am an expert in delivering customized scripts and like to discuss further about the project requirements

in %bids___i_period_sub_35% gün içinde84%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(18 Değerlendirme)

Hello. It was interesting for me to make something similar (I'm just learning web-parsing). So, the function is almost complete, I just need a nice sample: correct link :-) for testing I didn't used Queries, but used Daha Fazla

in %bids___i_period_sub_35% gün içinde10%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(18 Değerlendirme)

Dear Sir, I am very much interested in this project. With 8 year of corporate experience as Business Analyst and Reporting Specialist I am an expert in excel. I am new to freelancing, I need to establish a reput Daha Fazla

in %bids___i_period_sub_35% gün içinde40%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(8 Değerlendirme)

I am an expert in Microsoft Excel and had recently done a very similar task. creating query connection adjusting the VBA code and data manipulation to suit your format required.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(12 Değerlendirme)

Hello how are you may i help you ? can you send me more details about the requirements so i can send you the cost estimations? Let my profile approve the quality of work ---------------------------------------- Daha Fazla

in %bids___i_period_sub_35% gün içinde35%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(0 Değerlendirme)