Hi,
I'm trying to get data from a web site and load it into an Excel spreadsheet. Here is the query I'm using:
Public Sub Test1()
myLink = ActiveCell.Hyperlinks(1).Address
With ActiveSheet.QueryTables.Add(Connection:="url;" & myLink, _
Destination:=Range("a1")) 'write web-page to sheet
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.PreserveFormatting = True
.SaveData = True
.Refresh BackgroundQuery:=False
End With
End Sub
One column looks like this on the web page:
1/4
3/3H
4/5
5/8
2/1H
1/1H
6/24
7/DIS
but winds up looking like this:
4-Jan
3/3H
5-Apr
8-May
2/1H
1/1H
24-Jun
7/DIS
It's being treated like a date field and I want it to be treated like a text field. Any help appreciated.
I'm trying to get data from a web site and load it into an Excel spreadsheet. Here is the query I'm using:
Public Sub Test1()
myLink = ActiveCell.Hyperlinks(1).Address
With ActiveSheet.QueryTables.Add(Connection:="url;" & myLink, _
Destination:=Range("a1")) 'write web-page to sheet
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.PreserveFormatting = True
.SaveData = True
.Refresh BackgroundQuery:=False
End With
End Sub
One column looks like this on the web page:
1/4
3/3H
4/5
5/8
2/1H
1/1H
6/24
7/DIS
but winds up looking like this:
4-Jan
3/3H
5-Apr
8-May
2/1H
1/1H
24-Jun
7/DIS
It's being treated like a date field and I want it to be treated like a text field. Any help appreciated.