fari1
Active Member
- Joined
- May 29, 2011
- Messages
- 362
Code:
Pr
Code:
ivate Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.ScreenUpdating = False
Set shin = Sheets("info")
Set shti = Sheets("symbols")
With shin
Range("A21:E200").ClearContents
End With
Dim sts As String
sts = shin.Range("A1").Value
With shin.QueryTables.Add(Connection:= _
"URL;http://www.google.com" _
& sts, Destination:=shin.Range("A1"))
.Name = sicdata
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
On Error Resume Next
Call test
If Err.Number = 1004 Then
On Error GoTo errhandler
Exit Sub
Else
Call test
Call loopB
Call finalurl
Call findHTTPConvert
Call faricopy
Call furl
errhandler:
Select Case Err.Number
Case Is = 1004
Case Else
End Select
ActiveWorkbook.Connections("Connection").Delete
Call RemNamedRanges
End If
End If
End Sub