Getting multiple cell data and passing into query on HTTP call

SNA400

Board Regular
Joined
Nov 5, 2010
Messages
53
HI All,

I'm hoping someone can help me with an idea on how to action the below.

We have a spreadsheet that contains Commodity Codes for goods being imported and we need it to take that code along with the country of origin and pass it into a HTTP call to get details back from the UK Trade Tariff.
I have some code that currently passes just a single cell data and recovers the description of the goods

1736184060454.png

and this works fine (with further code below) i getting the information.

I have been trying with the following changes but keep getting an error.

LookupURL = "https://www.trade-tariff.service.gov.uk/api/v2/quotas/search?goods_nomenclature_item_id=" & ActiveCell.Offset(0, 51).Value '&geographical_area_id=""& ActiveCell.Offset(0, 52).Value"

the code I need to pass to the LookupURL is, as an example, https://www.trade-tariff.service.go...re_item_id=7608208990&geographical_area_id=TR

I am falling down where i am trying to pass the second portion of the data - &geographical_area_id= - because the code will not accept the second set of quote marks, and it is getting frustrating.

I know this is possible and I know i'm barking up the wrong tree using quote marks but for the life of me I don't know what way to go.

Help!

Simon
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try:

VBA Code:
    LookupURL = "https://www.trade-tariff.service.gov.uk/api/v2/quotas/search?goods_nomenclature_item_id=" & ActiveCell.Offset(0, 51).Value & "&geographical_area_id=" & ActiveCell.Offset(0, 52).Value

PS, please post code inside VBA tags, not as an image and then people can easily copy your code and help you.
 
Upvote 0

Forum statistics

Threads
1,225,613
Messages
6,186,005
Members
453,334
Latest member
Prakash Jha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top