Hello Everybody,
I would like to merge cells in different columns based on similar values in column "FN".
The attachment shows you how the result should look like.
Thank you very much for your support.
Niclal
Hello Everybody,
I would like to merge cells in different columns based on similar values in column "FN".
The attachment shows you how the result should look like.
Thank you very much for your support.
Niclal
Is only column "D" the one to merge?
- Battle without fear gives no glory - Just try
Try
![]()
Please Login or Register to view this content.
Hi,
All columns "Fil", "Gra", "Inac", "Doc" have to be merged.
Thank you
Niclal
So, what about the macro sent?
Hi,
This is exactly what I need. Would it be possible to have the results replace the original data instead of putting them in the sheet "After". The column headers are in the first row starting in A1.
Thank you so much in advance.
N
To change the sheets used is not a big deal:
from where the data is coming from:
change "Before" by the name of the sheet to use![]()
Please Login or Register to view this content.
where to put the data:
change "After" by the name of the sheet to use![]()
Please Login or Register to view this content.
Last edited by PCI; 11-21-2014 at 08:24 PM.
An update to be clean and smart
![]()
Please Login or Register to view this content.
Dear PCI,
one last question:
the location of the columns have been changed: column "FN" is now in column B, column "Fil", "Gra", "Ina", "Doc" are respective in column W, X, Y, Z. How should the code be revised?
Thank you very much
Capture.JPG
See how it works
![]()
Please Login or Register to view this content.
Hi PCI,
I am afraid, there is one piece of information I didn't mention: Column A as well as columns C to V has also content. After running the macro only one row (the first) should remain with information; all other duplicate rows should be removed.
Thank you so much
Can you send an update of your example showing sheet "Before" and "After".
Hi PCI,
I have now included an update of my table showing "Before" and "After" as tabs.
I really appreciate your time and help.
N
See how next code works
![]()
Please Login or Register to view this content.
Hi PCI,
When I test it with a similar table with the same column headers but more text, I get the error message "Run-time error 13 Type Mismatch" at the line "WSDest.Range("A2").Resize(.Count, 26) = Application.Transpose(Application.Transpose(.items))"
Any thoughts?
Thank you
N
Niclal,
Here again it will be really easier to have a sample of the file to see the problem: Can you?
When you say "more text" does it means more data inside one cell or more cells?
PCI
Hi PCI,
I fully understand that, but unfortunately, I cannot make the text public, and that's why I am trying to describe the content. The number of columns is the same as in Book2, I have around 1000 rows, the cells in the first column contain hyperlinks, and I have sometimes more data inside one cell.
I cannot tell how much I appreciate your help.
N
Give a chance to the file attached.
But of course the hyperlink will not be copied, only the cells' value
Last edited by PCI; 11-26-2014 at 03:11 PM.
Dear PCI,
Unfortunately, I still get the error message "Run-time error 13 - Type Mismatch" on line "WSDest.Range("A2").Resize(.Count, 26) = Application.Transpose(Application.Transpose(.items))"
Regards,
N
The macro is working with the sample file you sent and not with real one, is it?
Can you prepare a test file (with dummy data) reproducing the issue?
Dear PCI,
Good day! I have prepared a test file to demonstrate the error message I get.
Many thanks for your help
N
Try with your file attached
Dear PCI,
I would like to really thank you for the awesome help. You rock!
One last wish I have before closing this post: Could you please take a look at the column T in the attachment and revise your macro accordingly.
Thanks a bunch in advance.
N
Not sure to get it right.
It looks that between the result expected and the result from the macro there is a difference concerning linl1 and link6.
But for me the result (from the macro) is correct.
Please explain
Dear PCI,
My last question is about how to merge the values in column col20.
Let's take 2 examples:
In column FN, we have 3 "1001" and 4 "2011" ; for "1001" the corresponding values in column col20 are "0", blank, "1"; for "2011" the corresponding values in column col20 are "1", "1", "1", "1".
If the values contain at least one "1", then "1" is taken. If there is no "1", then "0" is taken.
In our 2 examples, that means: for the FN value "1001", the corresponding value in col20 is "1"; for the FN value "2011", the corresponding value in col20 is "1";
I hope, this is now clear.
Thanks a lot
N
Try the file attached.
It is not exactly the same result: See for 2014
Note, for column 20 the result will never be "", only 0 or 1
Hi PCI,
I'd like to thank you again for the great help you provided to me.
Thank you so much.
N
You're welcome.
Thank for your thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks