How to use an array ?

A

Amit

Hello group,


Below is the code that retrieves some information off a web server. As
you know better following code will place all information in cell A7
and following cells.


Now, since I need to create a progress bar I think that the best way
would be inserting all coming informatin into an array first. Then
afterwards, I will read the information from the array and will
populate the sheet then I can use a progress bar based on each row
being filled.


1) My question is how can I have this code to put information into
array instead of sheet first?

2) Currently this code is dependent to "sheet1". so if I make it as
Add-In it would expect to have sheet1 only. How can I modify my code in
a way that let it use any sheet? either sheet1 or sheet2 or ...?


3) How can I create a new sheet when there is nothing open initially?




Thank you so much.
AK


Dim strRq1 As String
Dim strRq2 As String
Dim strRq3 As String


On Error Resume Next


'Clean up the page
ActiveWindow.ActiveSheet.UsedRange.Clear


'Populate the sheet from A7 cell on
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & strRq1 & strRq2 & strRq3, _
Destination:=Range("A7"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top