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.
screenshot
VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Martin Liss

If you can, please attach a sample workbook.
Sasha2016

ASKER
Spreadsheet attached....thanks
sample.xlsm
Sasha2016

ASKER
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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Sasha2016

ASKER
Will revise and re-post....added blank rows (hopefully it will be easier for VBA code)
Martin Liss

It's not necessary. I'll have your solution in a few minutes.
Sasha2016

ASKER
Sound like solution is coming soon :)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Sasha2016

ASKER
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
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Sasha2016

ASKER
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?
Sasha2016

ASKER
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
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Martin Liss

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
Sasha2016

ASKER
Thanks again...I was really stuck on this :)
Martin Liss

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)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.