Manipulating Excel object using VB

sathyamoorthi
sathyamoorthi used Ask the Experts™
on
I will be getting an XML file from one application and i need to compare the data in that XML file with the data i get from another one application in Excel format. i can view the XML file in excel format, but my problem is the order in which the columns are arranged is different in both the files.

for example,
order of columns in first excel sheet:
A
B
C
D
E
order of columns in second excel sheet:
E
A
C
B
D

if i can column order is same in both the excel sheets, it will be easy for me to compare data in that.

How can i change the column order in one excel sheet to resemble the other one using VB code?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
You can do it in two ways.  Sort the data in EXCEL1 and EXCEL2 then compare OR you can copy the contents of EXCEL1 to vbarray1 and EXCEL2 to vbarray2 then sort them, then compare.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for harris_c

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial