how to pass on different parameters to VBA Code?

A

Ahmaq

Hi Friends,

For below code, i need to create a macro which copy the URL from a cell and
pass on to the web query URL written in another macro:

ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.website.com", _
Destination:=Range("D20"))

Can you please advise how to pass on different parameters to above code?

Thanks in advance.
 
S

Stan Brown

Sat, 21 Apr 2007 08:38:00 -0700 from Ahmaq
For below code, i need to create a macro which copy the URL from a cell and
pass on to the web query URL written in another macro:

ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.website.com", _
Destination:=Range("D20"))

Can you please advise how to pass on different parameters to above code?

I think you mean you want to pass the URL in the currently selected
cell. If that's correct, see the Selection property in VBA help.
 
A

Ahmaq

Thanks Brown for your reply.

Let me rephrase my question:

Cell A1 contains URL. I want to pass on this URL to VBA code mentioned
below. The URL in cell A1 should be used in below VBA code:

ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.website.com", _

Thanks in advance
 

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