Search for a values in 2 sheets using macro

[Closed]
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hi,

I have Response XMl Schema from 2 different environment of an application in sheet1 and sheet2 on the msexcel . I have a collection of xml tags in sheet3.

I want to write a macro which do the following
(e.g)

<State>TN</State>
<Country>INDIA</Country>
............
etc.......


1. I have to select the xml tag(Country) from sheet3 .
2. goto sheet 1 and search whether the Tag is displayed in the Response XMl Schema for the 1st environment.
3. then goto sheet 2 and search whether the Tag is displayed in the Response XMl Schema for the 2nd environment.
4. update the Tag name and status (i.e tag is present) in a new sheet4.


Can anyone please help me out to write a macro to perform the above activity.



Thanks,
Priya.

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
wont you have multiple <country></country> tags in your xml ?
yes . There may be multiple transactions in the response, All transaction may or may not have tags. I have to validate these set of tags are present in atleast 1 transaction.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Well if it is an XML doc why not just parse it ?
Also would your document be a proper xml and each tag would have an appropriate closing tag in the right nest
Its not a xml document ...

This is basically, XML responses of a service which is run on 2 different environments.

Each tag will have a appropriate closing tag in the nest.

I have extracted the responses in to a excel sheet from 2 environments to validate whether the correct responses are received on both the environments.

To validate the responses, I have a list of required tags( like state, zipcode, city etc) within an transaction should be present.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Could you post a sample workbook at some shared site