Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tx12345
 
Posts: n/a
Default Web Query: Obtaining source link from a cell


Hi

When I create a macro for a web query, the code looks like this:


Code:
--------------------
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.etc.com/mypage.htm" _
, Destination:=Range("C4"))

--------------------


But this macro is only good for one web page. How can I query another
web page without changing the macro, where the new web address come
from a particular cell on the worksheet?

All ideas welcome
Thx


--
tx12345
------------------------------------------------------------------------
tx12345's Profile: http://www.excelforum.com/member.php...o&userid=24776
View this thread: http://www.excelforum.com/showthread...hreadid=499068

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Michael Gill
 
Posts: n/a
Default Web Query: Obtaining source link from a cell

Hi,

Assuming cell A1 contains your URL just use the following code:
myQuery = Range("A1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
myQuery _
, Destination:=Range("C4"))

Michael

"tx12345" wrote:


Hi

When I create a macro for a web query, the code looks like this:


Code:
--------------------
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.etc.com/mypage.htm" _
, Destination:=Range("C4"))

--------------------


But this macro is only good for one web page. How can I query another
web page without changing the macro, where the new web address come
from a particular cell on the worksheet?

All ideas welcome
Thx


--
tx12345
------------------------------------------------------------------------
tx12345's Profile: http://www.excelforum.com/member.php...o&userid=24776
View this thread: http://www.excelforum.com/showthread...hreadid=499068


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Help Robert Excel Worksheet Functions 15 January 3rd 06 02:17 AM
Link to Cell Not Updating Jason Excel Worksheet Functions 3 December 19th 05 03:37 AM
copy combobox - cell link to change automatically Bojana Excel Worksheet Functions 1 June 8th 05 02:35 PM
Updating master workbook from source that may/may not exist [email protected] Excel Worksheet Functions 20 April 7th 05 03:37 PM
External link using calculated cell value Doug Excel Worksheet Functions 1 March 15th 05 08:05 AM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"