Link to home
Start Free TrialLog in
Avatar of Sasha2016
Sasha2016

asked on

Combine cell data based on adjacent cells?

Combine cell data based on values in adjacent cells. Sample screenshot attached.

Is there a formula or VBA that can achieve this?
It's OK to have helper columns if needed.
User generated image
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

If you can, please attach a sample workbook.
Avatar of Sasha2016
Sasha2016

ASKER

Spreadsheet attached....thanks
sample.xlsm
Would it be easier if there are blank rows separating cells?

I've been trying (without success) to find a VBA code that would do following:
If AB is NOT blank, concatenate values from AD until blank row reached
Will revise and re-post....added blank rows (hopefully it will be easier for VBA code)
It's not necessary. I'll have your solution in a few minutes.
Sound like solution is coming soon :)
Hi Martin,
See attached sample, if it's easier to achieve this with blank rows, that would work too....which ever version of the file works for you.
Thanks!
Book1.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Martin,
Thanks for this...It's huge help!
Only thing I noticed that needs a tweak is the last row with info...it adds a bunch of semi-colons    ;;;;;;;;;;
Any way to correct that?
Never mind...I found a work-around. I'll have it delete rows after last one with info prior to running your code.
Just tested it...works great!

Thanks again!
Sasha
Sorry I didn't notice that. There was some formatting below row 91 that caused VBA to miscalculate the last row with data. That's been corrected in the attached workbook.
29126114a.xlsm
Thanks again...I was really stuck on this :)
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
              Experts Exchange Top Expert VBA (current)