Hello Experts,
I new in VBA, I need your help.
How do I loop the procedure/macro until I cancel the InputBox or remain empty value InputBox??
TIA,
I new in VBA, I need your help.
How do I loop the procedure/macro until I cancel the InputBox or remain empty value InputBox??
Code:
Sub FundData()
Dim TikerName As String
TikerName = Application.InputBox(Prompt:="Please enter Share Code", Type:=2)
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://dsebd.org/displayCompany.php?name=" & TikerName, Destination:=Range( _
"$A$1"))
'.CommandType = 0
.Name = "displayCompany.php?name=" & TikerName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = """company"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveSheet.Name = TikerName
Sheets.Add After:=ActiveSheet
ThisWorkbook.Save
End Sub
TIA,