Help on coding?

E

Eric

Refer to the post in Worksheet function.

Does anyone have any suggestion on how to do it in excel?

There is the format for the macro query.
qryConnect = "URL;http://www.myurl.com/filename.html"

There is a list of file names on column A under Lists worksheet.
Does anyone have any suggestions on how to retrieve the character on column
A under worksheet lists and insert into the query in order to do the
following tasks?

For example,
qryConnect = "URL;http://www.myurl.com/john.html"
qryConnect = "URL;http://www.myurl.com/1.html"

I would like to load a list of web links into Temp worksheet, after the
first link is loaded from cell A1 under Lists worksheet, then retrieve the
value in cell A10 under Temp worksheet and paste this value into B1 under
Lists worksheet. After that,

repeat for the next web links ...

after the second link is loaded from cell A2 under Lists worksheet, then
retrieve the value in cell A10 under Temp worksheet and paste this value into
B2 under Lists worksheet.

repeat for the next web links ...

after the third link is loaded from cell A3 under Lists worksheet, then
retrieve the value in cell A10 under Temp worksheet and paste this value into
B3 under Lists worksheet.

repeat for the next web links ...

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric
 
J

Joel

Below is code that was created using Record Macro while performing a web query.

Notice the items which are string (between double quotes)


"URL;http://www.myurl.com/search.php?uid=ws547d65f0b56a435.80901093&src="

you can add a variable to this string like the code below

MyVariable
"URL;http://www.myurl.com/search.php?uid=" & MyVariable & "="

Below is the recorded macro

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://www.myurl.com/search.php?uid=ws547d65f0b56a435.80901093&src=", _
Destination:=Range("H24"))
.Name = "search.php?uid=ws547d65f0b56a435.80901093&src="
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.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
 
E

Eric

Thank you for your suggestions
Could you please present the coding in macro coding format?
I cannot apply those code at this moment.
Thank you for any suggestions
Eric
 

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