Thread: FORMULA OR VB
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
cht13er cht13er is offline
external usenet poster
 
Posts: 141
Default FORMULA OR VB

On Mar 16, 5:09 pm, Tomkat743
wrote:
I AM HAVING TROUBLE TRYING TO FIGURE OUT WHICH FORMULA WOULD WORK BEST FOR
THE FOLLOWING OR IF I NEED TO HAVE VB TO DO THIS. I NEED TO PUT THE DATA FROM
COLUMN B IN THE SAME ROW IF I HAVE MATCHING DATA IN COLUMN A.

7400 1A
7400 2A
7400 3A
7401 1A
7401 2A

RESULT.

7400 1A,2A,3A
7401 1A,2A

OR IT COULD BE IN COLUMNS

7400 1A 2A 3A
7401 1A 2A

EITHER WAY THANKS TO ANYONE THAT CAN GIVE ME AN IDEA.


Please do not post in CAPS - it's hard to read.

This looks like a pivot table's output!

However, if you do wish to do it in VB to avoid the formatting and
references, etc, you could try this:
1) Get an array of all column A entries (7400 and 7401)
2) Print these entries in a different location
3) Look at each entry in column B, then check if it matches the
entries that you've moved somewhere else
4) If it does, write it into the first blank empty cell / concatenate
the existing text

that's it .. if you have any questions regarding the coding you can
post again here. It's always best to try it out first though!

Chris