Hi Team,
PFA my sample document. Here,
I Need to compare TD sheet with DB2 and make sure we have the same order of columns present in TD Sheet, if not then need to sort it according to DB2 sheet.
Thanks
Anand R
Hi Team,
PFA my sample document. Here,
I Need to compare TD sheet with DB2 and make sure we have the same order of columns present in TD Sheet, if not then need to sort it according to DB2 sheet.
Thanks
Anand R
Hi Anand,
Try this:
Please Login or Register to view this content.
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
Hi
Thanks for the reply.
I ran your code it is working fine but my scenario is that
a) Check the order of columns are placed (present) in DB Sheet
b) if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise
Regards,
Anand R
Hi Anand,
My program yields exactly the same output as in your example - can you post a different example?
I changed the headers
Please Login or Register to view this content.
Last edited by xladept; 02-02-2015 at 04:16 PM.
Hi,
I ran you code in my local.
You are writing TRUE values in Compared Sheet. But I write cells values (not true / false values) in TD sheet which is different order from DB sheet.
And Sort column wise for the both Sheet.
Thanks
Anand R
Can you post an example illustrating what you need?
Hi,
Please find my 2 sample document -- one is input and other is output which i need after running the macro.
My requirement is :
a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise
Thanks & Regards.
Anand R
See if this is what you wanted:
Please Login or Register to view this content.
Hi,
There would be only one file (input file) and i need the out put as mentioned in out put file after running the macro. For reference i have sent 2 excel documents. Please don't write any values like TRUE or FALSE in any sheets. In my input file please compare the TD and DB sheet and do the following...
a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise
Thanks
Anand R
Another attempt:
Please Login or Register to view this content.
Hi,
Why are you using
Set wo = Workbooks("Output_Sheet.xlsx")
As i said earlier, my sample file will be like input file that i attached. I need to do the following
a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise.
after running the macro, the file should be like output file...So doesn't mean that we need to take output file.
In our case, all excel files are stored in a path and need to iterate each excels (input file) need out put as in output file after running your code.
Hope i didn't confuse you.
Thanks
Anand R
After above operation i need to save it
Thanks
Anand r
Hi Anand,
I am confused - I used Input_Sheet and Output_Sheet because that's what you provided in your sample. What is it that you need that I haven't supplied?
I believe that my routine does all that?a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise.
Hi,
Let me put straight forward...
i want the output as in output file from input file... ie.. we have only one input file. In that input i need to do the following things
a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by column wise.
d) i need the output as in output file after doing the above a,b,c steps
e) Save the input file
I saw your code.. you are using the output file .. not at all. my output should be like in output file by overwriting the values in existing input file itself.
Hope i am correct now this time
Thanks
Anand R
Maybe:
Please Login or Register to view this content.
Try
Please Login or Register to view this content.
Hi,
Let me try and i'll let you know..
BTW, Is it possible for row wise
a) Check the order of columns are placed (present) in DB Sheet
b) Check if the order of columns are placed differently in TD sheet, then place as in DB sheet (order like in DB Sheet)
c) And sort the DB and TD sheet by row wise.
d) i need the output as in output file after doing the above a,b,c steps
e) Save the input file
regards,
Anand R
What is your goal?
If you want to check the difference, no need to sort at all.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks