SOLVED
Home

Concatenating column B values if left adjacent cell is empty

%3CLINGO-SUB%20id%3D%22lingo-sub-754945%22%20slang%3D%22en-US%22%3EConcatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-754945%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20combine%20cells%20in%20column%20B%20if%20the%20value%20in%20the%20cell%20to%20the%20left%20is%20blank%20while%20also%20deleting%20the%20blank%20cell%20to%20the%20left%20to%20close%20any%20gaps%20between%20cells%20in%20Column%20A.%20The%20best%20way%20for%20me%20to%20explain%20this%20is%20by%20showing%20an%20example.%20I%20need%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EColumn%20A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BColumn%20B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ETest%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20This%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BThat%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BOther%3C%2FP%3E%3CP%3ETest2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Also%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BThis%3C%2FP%3E%3CP%3ETest3%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Please%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BHelp%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BMe%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20look%20like%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EColumn%20A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Column%20B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ETest%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20This%2C%20That%2C%20Other%3C%2FP%3E%3CP%3ETest2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Also%2C%20This%3C%2FP%3E%3CP%3ETest3%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Please%2C%20Help%2C%20Me%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20quite%20sure%20how%20to%20word%20my%20question%20to%20search%20so%20I%20apologize%20if%20this%20has%20been%20asked%20many%20times!%20%3A)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-754945%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-754986%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-754986%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20a%20formula%20to%20return%20your%20concatenated%20text%20and%20have%20Excel%202016%20on%20Office%20365%20subscription%20(or%20Excel%202019)%2C%20then%20you%20may%20copy%20down%20a%20TEXTJOIN%20formula%3A%3C%2FP%3E%0A%3CPRE%3E%3DTEXTJOIN(%22%2C%22%2CTRUE%2CINDEX(B%3AB%2CMATCH(D2%2CA%3AA%2C0))%3AINDEX(B%3AB%2CIFERROR(MATCH(D3%2CA%3AA%2C0)-1%2CMAX(MATCH(%7B%22zzzzz%22%2C1E%2B307%7D%2CB%3AB%2C1)))))%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-754988%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-754988%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20could%20be%20done%20with%20Power%20Query%20-%20query%20the%20date%2C%20fill%20down%20first%20column%2C%20group%20by%20it%2C%20add%20column%20with%20initial%20second%20column%20as%20list%20and%20extract%20it%20with%20separator%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20324px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123302i5EE9C0FD165AADB1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-754997%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-754997%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%20for%20your%20quick%20response%20here.%20I%20am%20trying%20this%20formula%20now.%20I%20am%20a%20novice%20when%20it%20comes%20to%20excel%20so%20I%20have%20a%20few%20questions.%3C%2FP%3E%3CP%3EI%20tried%20running%20that%20formula%20is%20column%20C%20and%20the%20return%20is%20%23N%2FA.%20What%20do%20I%20need%20to%20change%20here%3F%3C%2FP%3E%3CP%3EIs%20column%20C%20the%20correct%20column%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755004%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755004%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20responding%20so%20quickly%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E.%20I%20am%20pretty%20green%20when%20it%20comes%20to%20excel%20but%20have%20been%20working%20with%20it%20extensively%20in%20my%20new%20position.%20If%20you%20have%20the%20time%2C%20could%20you%20explain%20Power%20Query%20a%20bit%20more%3F%20I%20would%20like%20to%20know%20more%20about%20it%20from%20someone%20who%20has%20obviously%20used%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755029%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755029%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Jay%2C%3C%2FP%3E%3CP%3Ethere%20are%20a%20solution%20with%20help%20of%20the%20follwing%20macro%3A%3C%2FP%3E%3CPRE%3ESub%20GroupData()%3CBR%20%2F%3EDim%20lngRow%20As%20Long%3CBR%20%2F%3EDim%20lngRowMax%20As%20Long%3CBR%20%2F%3EDim%20lngz%20As%20Long%3CBR%20%2F%3EDim%20lngzMax%20As%20Long%3CBR%20%2F%3E%3CBR%20%2F%3EWith%20Sheet1%3CBR%20%2F%3E.Range(%22G%3AH%22).ClearContents%3CBR%20%2F%3E.Range(%22G1%3AH1%22).Value%20%3D%20.Range(%22A1%3AB1%22).Value%3CBR%20%2F%3Elngz%20%3D%202%3CBR%20%2F%3ElngRowMax%20%3D%20.Range(%22B%22%20%26amp%3B%20.Rows.Count).End(xlUp).Row%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20lngRow%20%3D%202%20To%20lngRowMax%3CBR%20%2F%3EIf%20.Range(%22A%22%20%26amp%3B%20lngRow).Value%20%26lt%3B%26gt%3B%20%22%22%20Then%3CBR%20%2F%3E.Range(%22G%22%20%26amp%3B%20lngz).Value%20%3D%20.Range(%22A%22%20%26amp%3B%20lngRow).Value%3CBR%20%2F%3E.Range(%22H%22%20%26amp%3B%20lngz).Value%20%3D%20.Range(%22B%22%20%26amp%3B%20lngRow).Value%3CBR%20%2F%3Elngz%20%3D%20lngz%20%2B%201%3CBR%20%2F%3EElse%3CBR%20%2F%3ElngzMax%20%3D%20.Range(%22H%22%20%26amp%3B%20.Rows.Count).End(xlUp).Row%3CBR%20%2F%3E.Range(%22H%22%20%26amp%3B%20lngzMax).Value%20%3D%20.Range(%22H%22%20%26amp%3B%20lngzMax).Value%20%26amp%3B%20%22%2C%22%20%26amp%3B%20.Range(%22B%22%20%26amp%3B%20lngRow).Value%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3ENext%20lngRow%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20Sub%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20regards%3CBR%20%2F%3EBernd%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fvba-tanker.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fvba-tanker.com%2F%3C%2FA%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755044%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755044%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20prefer%20a%20macro%20to%20concatenate%2C%20then%20consider%3A%3C%2FP%3E%0A%3CPRE%3ESub%20Sequelize()%0ADim%20rg%20As%20Range%2C%20targ%20As%20Range%0ADim%20delimiter%20As%20String%2C%20s%20As%20String%0ADim%20i%20As%20Long%2C%20j%20As%20Long%2C%20n%20As%20Long%0A%0Adelimiter%20%3D%20%22%2C%20%22%0ASet%20rg%20%3D%20Range(%22A2%22).CurrentRegion%0ASet%20rg%20%3D%20rg.Offset(1%2C%200).Resize(rg.Rows.Count%20-%201%2C%20rg.Columns.Count)%0An%20%3D%20rg.Rows.Count%0Aj%20%3D%201%0AFor%20i%20%3D%20n%20To%201%20Step%20-1%0A%20%20%20%20If%20rg.Cells(i%2C%201).Value%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20rg.Rows(i%20%2B%201).Resize(j%20-%201).EntireRow.Delete%0A%20%20%20%20%20%20%20%20If%20rg.Cells(i%2C%202).Value%20%26lt%3B%26gt%3B%20%22%22%20Then%20s%20%3D%20rg.Cells(i%2C%202).Value%20%26amp%3B%20delimiter%20%26amp%3B%20s%0A%20%20%20%20%20%20%20%20If%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%20rg.Cells(i%2C%202).Value%20%3D%20Left(s%2C%20Len(s)%20-%20Len(delimiter))%0A%20%20%20%20%20%20%20%20j%20%3D%201%0A%20%20%20%20%20%20%20%20s%20%3D%20%22%22%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20j%20%3D%20j%20%2B%201%0A%20%20%20%20%20%20%20%20If%20rg.Cells(i%2C%202).Value%20%26lt%3B%26gt%3B%20%22%22%20Then%20s%20%3D%20rg.Cells(i%2C%202).Value%20%26amp%3B%20delimiter%20%26amp%3B%20s%0A%20%20%20%20End%20If%0ANext%0AEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755055%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755055%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20formula%20was%20assuming%20that%20you%20already%20had%20the%20column%20A%20values%20listed%20as%20in%20your%20initial%20post.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20you%20subsequently%20changed%20your%20question%2C%20I%20wrote%20a%20macro%20to%20do%20the%20new%26nbsp%3B%20request.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20attached%20workbook%20shows%20both%20the%20macro%20and%20the%20formula.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755106%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755106%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E.%20I%20am%20trying%20to%20test%20this%20now%20on%20my%20actual%20worksheet%20and%20the%20only%20problem%20I%20am%20having%20is%20that%20the%20sheet%20is%20260%2C000%20rows%20and%20my%20computer%20will%20freeze%20every%20time%20I%20try%20anything.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755132%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755132%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20post%20a%20small%20sample%20workbook%20showing%20your%20actual%20data%20layout.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20propose%20to%20use%20array%20transfer%20for%20speed%2C%20and%20want%20to%20get%20the%20code%20right%20the%20first%20time.%20I%20therefore%20need%20to%20know%20the%20layout%2C%20extent%20of%20data%20and%20complicating%20factors%20(merged%20cells%2C%20worksheet%20protection%2C%20adjacent%20columns%20that%20must%20not%20be%20deleted%2C%20blank%20rows%2C%20etc).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBrad%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755138%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755138%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPower%20Query%20-%20you%20may%20start%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fgetting-started-with-get-transform-in-excel-a8310388-2a12-438c-9d29-c6d29cb8df6a%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGetting%20Started%20with%20Get%20%26amp%3B%20Transform%20in%20Excel%3C%2FA%3E%26nbsp%3B%2Cit%20gives%20the%20main%20idea.%20Technology%20requires%20some%20time%20to%20invest%2C%20but%20you%20may%20start%20doing%20something%20practical%20from%20very%20first%20steps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20this%20sample%20you%20may%20open%20the%20query%20(Data-%26gt%3BQueries%20%24%20Connections%2C%20double%20click%20on%20query%20in%20the%20right%20pane)%20and%20check%20step%20by%20step%20what%20it's%20doing.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755205%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755205%22%20slang%3D%22en-US%22%3E%3CP%3EGoing%20somewhat%20out%20on%20a%20limb%20here%20without%20a%20sample%20workbook%20to%20look%20at.%20I%20revised%20the%20code%20to%20use%20array%20transfer%20into%20VBA%20and%20back.%20It%20will%20run%20a%20lot%20faster%20as%20a%20result.%3C%2FP%3E%0A%3CPRE%3ESub%20Sequelize()%0ADim%20rg%20As%20Range%0ADim%20delimiter%20As%20String%2C%20s%20As%20String%0ADim%20i%20As%20Long%2C%20k%20As%20Long%2C%20n%20As%20Long%2C%20nData%20As%20Long%0ADim%20vData%20As%20Variant%2C%20vResults%20As%20Variant%0A%0Adelimiter%20%3D%20%22%2C%20%22%0ASet%20rg%20%3D%20Range(%22A2%22).CurrentRegion%0ASet%20rg%20%3D%20rg.Offset(1%2C%200).Resize(rg.Rows.Count%20-%201%2C%20rg.Columns.Count)%0An%20%3D%20rg.Rows.Count%0AnData%20%3D%20Application.CountA(rg.Columns(1))%0AvData%20%3D%20rg.Value%0AReDim%20vResults(1%20To%20nData%2C%201%20To%202)%0A%0AFor%20i%20%3D%201%20To%20n%0A%20%20%20%20If%20vData(i%2C%201)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20%2B%201%0A%20%20%20%20%20%20%20%20vResults(k%2C%201)%20%3D%20vData(i%2C%201)%0A%20%20%20%20%20%20%20%20If%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20i%20%26gt%3B%201%20Then%20vResults(k%20-%201%2C%202)%20%3D%20s%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20s%20%3D%20IIf(vData(i%2C%202)%20%3D%20%22%22%2C%20%22%22%2C%20vData(i%2C%202))%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20If%20vData(i%2C%202)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20s%20%3D%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20Else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20s%20%26amp%3B%20delimiter%20%26amp%3B%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20End%20If%0ANext%0AIf%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%20vResults(k%2C%202)%20%3D%20s%0A%0Arg.ClearContents%0Arg.Resize(nData%2C%202).Value%20%3D%20vResults%0AEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755218%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755218%22%20slang%3D%22en-US%22%3E%3CP%3EI%20apoligize%20for%20the%20delay%20in%20response%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E.%20I%20was%20having%20trouble%20with%20my%20laptop%20because%20excel%20was%20crashing%20often.%20I%20will%20attach%20a%20very%20small%20sample%20of%20the%20data%20I%20am%20working%20with.%20I%20am%20basically%20looking%20at%20all%20the%20software%2Fapplications%20installed%20on%20all%20the%20servers%20in%20my%20domain.%20I%20want%20all%20the%20applications%20belonging%20to%20each%20server%20to%20be%20in%20one%20cell%20block%20and%20be%20separated%20by%20a%20comma.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServerA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BIE%2CChrome%2CWindows%20Update%2C%20Intel%20driver%2C%20Edge%2C%20etc...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServerB%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BChrome%2C%20Nvidia%20GPU%20Driver%2C%20Edge%2C%20etc....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERather%20than%20what%20it%20currently%20is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServerA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BIE%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Chrome%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BWindows%20Update%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Intel%20driver%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Edge%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20etc...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EServer%20B%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BChrome%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Nvidia%20GPU%20Driver%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Edge%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20etc....%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755249%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755249%22%20slang%3D%22en-US%22%3EI%20just%20bookmarked%20this.%20I%20will%20read%20it%20on%20my%20next%20break.%20Thank%20you%20Sergei.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755284%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755284%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20most%20recent%20macro%20is%20working%20on%20your%20test%20workbook.%20I%20installed%20the%20code%2C%20added%20a%20button%20to%20call%20it%20in%20the%20attached%20workbook%20so%20you%20may%20test.%20The%20duplicate%20data%20off%20to%20the%20right%20is%20so%20I%20can%20easily%20restore%20the%20original%20condition.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBrad%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755289%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755289%22%20slang%3D%22en-US%22%3EI%20just%20ran%20it%20on%20my%20actual%20worksheet%20and%20it%20deleted%20everything%20below%20row%201.%20I%20may%20not%20be%20executing%20this%20properly.%20I%20went%20to%20view%20macros%2C%20create%2C%20pasted%20in%20the%20macro%20from%20above%2C%20saved%20it%2C%20then%20ran%20that%20macro.%20I%20assume%20this%20is%20how%20I%20am%20supposed%20to%20do%20it%20but%20maybe%20I%20am%20incorrect.%20Also%20my%20actual%20worksheet%20has%20260%2C000%20rows%20of%20data%20but%20that%20shouldn't%20affect%20it%2C%20correct%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755291%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755291%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20Power%20Query%20version.%20Applications%20are%20sorted%20alphabetically%20in%20the%20list.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755310%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755310%22%20slang%3D%22en-US%22%3EI%20have%20never%20used%20Power%20Query.%20This%20is%20something%20I%20will%20have%20to%20research%20more%20as%20I%20haven't%20the%20slightest%20clue%20how%20to%20utilize%20it.%20I%20see%20it%20works%20beautifully.%20I%20will%20start%20my%20reading%20now.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755320%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755320%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMacro%20which%20Brad%20suggested%20works%20fine%2C%20but%20if%20you%20never%20used%20VBA%20it%20also%20takes%20time%20to%20learn%20how%20it%20works.%20VBA%20is%20much%20more%20universal%2C%20but%2C%20from%20my%20point%20of%20view%2C%20Power%20Query%20is%20more%20suitable%20for%20data%20transform%20tasks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755322%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755322%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20macro%20assumes%20your%20data%20starts%20in%20row%202%20and%20that%20header%20labels%20are%20in%20row%201.%20It%20further%20assumes%20that%20you%20have%20no%20blank%20lines%20in%20your%20data%2C%20and%20that%20there%20are%20only%20two%20columns%20of%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYour%20question%20said%20that%20you%20wanted%20to%20start%20with%20two%20columns%20of%20data%20in%20columns%20A%20and%20B%2C%20then%20end%20up%20with%20two%20columns%20of%20compacted%20results%20in%20columns%20A%20and%20B.%20That's%20what%20the%20macro%20does.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20third%20from%20the%20last%20statement%20in%20the%20macro%20deletes%20the%20existing%20data%20(except%20header%20labels).%20The%20next%20to%20last%20statement%20puts%20the%20compacted%20results%20starting%20in%20cell%20A2.%20If%20you%20want%20them%20moved%20elsewhere%2C%20that%20statement%20is%20easily%20changed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20made%206270%20copies%20of%20your%20data%2C%20filling%20the%20sheet%20past%20row%20260000%20and%20ran%20the%20macro.%20It%20completed%20work%20in%20less%20than%20a%20second.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755349%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755349%22%20slang%3D%22en-US%22%3EI%20feel%20like%20I%20am%20missing%20something%20very%20simple%20that%20is%20just%20going%20over%20my%20head%20here.%20My%20data%20headers%20%22ComputerName%22in%20column%20A%20and%20%22Application%22%20in%20column%20B%20are%20in%20row%201.%20Data%20starts%20in%20row%202.%20Column%20B%20has%20no%20blank%20cells%20but%20Column%20A%20has%20many%20blank%20cells.%20I%20had%20deleted%20the%20duplicate%20server%20names.%20To%20me%2C%20it%20looks%20almost%20identical%20to%20the%20sample%20I%20submitted.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20whatever%20reason%2C%20when%20I%20run%20the%20macro%20it%20just%20deletes%20all%20the%20data.%20I%20ran%20the%20script%20in%20the%20sample%20I%20gave%20you.%20It%20worked%20there.%20It%20will%20not%20work%20on%20my%20actual%20sheet.%20It%20hangs%20for%20a%20second%20or%20so%20then%20just%20deletes%20everything.%20I%20am%20sorry.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20wish%20I%20could%20understand%20this%20better%20and%20apologize%20if%20it%20feels%20like%20you%20are%20talking%20to%20a%205%20year%20old!%20lol.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755686%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755686%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20select%20column%20A%20with%20your%20raw%20data%2C%20how%20many%20values%20are%20there%3F%20It%20should%20say%20something%20like%20Count%3A%206267%20at%20the%20right%20of%20the%20status%20bar%20at%20the%20bottom%20of%20the%20application%20window.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20909px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123324i80103F9FF838852D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755823%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755823%22%20slang%3D%22en-US%22%3E%3CP%3ECurrently%20235493%20entries%20on%20column%20A.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755832%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755832%22%20slang%3D%22en-US%22%3E%3CP%3EAlthough%2090%25%20or%20more%20are%20empty%20cells.%20I%20am%20not%20sure%20why%20they%20are%20registering%20as%20entries%20if%20they%20are%20empty.%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755835%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755835%22%20slang%3D%22en-US%22%3EAlthough%2090%25%20or%20more%20are%20empty%20cells.%20I%20am%20not%20sure%20why%20they%20are%20registering%20as%20entries%20if%20they%20are%20empty.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755863%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755863%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMight%20you%20have%20empty%20strings%20or%20spaces%20in%20those%20%22blank%22%20cells%3F%20If%20you%20do%2C%20the%20macro%20won't%20work%20right.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755921%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755921%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20test%20whether%20a%20cell%20is%20truly%20blank%20using%20a%20formula%20like%3A%3C%2FP%3E%0A%3CPRE%3E%3DISBLANK(A2)%3C%2FPRE%3E%0A%3CP%3EMy%20guess%20is%20that%20many%20of%20your%20column%20A%20cells%20look%20blank%20but%20actually%20contain%20an%20invisible%20value%2C%20such%20as%20a%20single%20quote%2C%20space%2C%20non-breaking%20space%2C%20Tab%20or%20Carriage%20Return%20character.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757278%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757278%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20are%20correct%20here%20Brad.%20Could%20you%20assist%20me%20in%20emptying%20or%20formatting%20these%20%22empty%22%20cells%20while%20still%20leaving%20a%20cell%20in%20place%3F%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757388%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757388%22%20slang%3D%22en-US%22%3E%3CP%3EI%20formatted%20the%20empty%20cells%20and%20tested%20them%20with%20the%20%3Disblank%20and%20they%20all%20came%20up%20false%2C%20except%20for%20of%20course%20the%20cells%20with%20actual%20values.%20Although%20after%20deleting%20that%20%3Disblank%20column%20I%20still%20was%20unable%20to%20get%20the%20macro%20to%20run%20correctly.%20It%20is%20still%20deleting%20all%20the%20data%20in%20the%20worksheet.%20I%20am%20not%20sure%20what%20I%20am%20doing%20wrong.%20Will%20troubleshoot%20a%20bit%20more%20but%20I%20thought%20you%20might%20want%20an%20update.%20I%20also%20checked%20column%20B%20for%20blanks%20and%20came%20up%20with%20none%20as%20well.%20Thanks%20again%20Brad.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757424%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757424%22%20slang%3D%22en-US%22%3E%3CP%3EHere%20is%20a%20couple%20screenshots%20of%20the%20macro%20with%20a%20before%20and%20after%20running.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757504%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757504%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20would%20like%20test%20my%20code%20on%20your%20actual%20workbook.%20It's%20OK%20if%20you%20replace%20all%20the%20data%20with%20the%20letter%20%22x%22%20as%20long%20as%20you%20can%20reproduce%20the%20problem.%20You%20can%20post%20a%20workbook%20in%20this%20thread%2C%20or%20you%20could%20email%20it%20to%20me%20at%20first%20initial%20last%20name%20at%20my%20ISP%2C%20which%20is%20alum%20dot%20mit%20dot%20edu.%20I%20would%20then%20like%20to%20try%20reproducing%20the%20problem.%20Fixing%20the%20problem%20is%20easy%20if%20I%20can%20reproduce%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt's%20possible%20that%20there%20is%20a%20limitation%20of%20Excel%20VBA%20present%20in%20your%20version%20of%20Excel%20that%20is%20not%20in%20mine.%20All%20my%20testing%20so%20far%20has%20been%20on%2064-bit%20Excel%202016%2FOffice%20365%20running%20on%20Windows%2010--but%20I%20have%20other%20versions%20available%20for%20testing%20(both%20Mac%20and%20Windows%2C%2032-bit%20and%2064-bit%2C%202007%20to%20date).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20tell%20me%3A%3C%2FP%3E%0A%3CP%3EWhich%20version%20of%20Excel%20do%20you%20use%2C%20Mac%20or%20Windows%3F%3C%2FP%3E%0A%3CP%3EIf%20Windows%2C%20is%202007%2C%202010%2C%202013%2C%202016%20or%202019%3F%3C%2FP%3E%0A%3CP%3EIs%20it%2032-bit%20or%2064-bit%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757516%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757516%22%20slang%3D%22en-US%22%3EI%20am%20currently%20running%20on%20Windows%207%20and%20using%20MSOffice%20365%20ProPlus%20ver.%2016.0.9126.2315%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20found%20that%20if%20I%20run%20the%20macro%20on%20smaller%20portions%20of%20data%2C%20it%20will%20run%20just%20fine.%20I%20am%20most%20the%20way%20through%20my%20document%20by%20now.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757574%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757574%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20sending%20me%20the%20file.%20I%20can%20reproduce%20the%20problem%20with%20my%20Excel%202016%2FOffice%20365%2064-bit.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExcel%20cells%20can%20hold%20a%20maximum%20of%2032%2C767%20characters.%20Your%20problem%20server%20has%2086%2C510%20characters%20worth%20of%20software.%20I%20am%20guessing%20an%20overflow%20occurs%20that%20results%20in%20the%20loss%20of%20your%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20test%20this%20hypothesis%2C%20I%20modified%20the%20code%20to%20truncate%20the%20software%20list%20to%20the%20first%2032%2C767%20characters.%20Now%20the%20macro%20seems%20to%20work.%3C%2FP%3E%0A%3CPRE%3ESub%20Sequelize()%0ADim%20rg%20As%20Range%0ADim%20delimiter%20As%20String%2C%20s%20As%20String%0ADim%20i%20As%20Long%2C%20k%20As%20Long%2C%20n%20As%20Long%2C%20nData%20As%20Long%0ADim%20vData%20As%20Variant%2C%20vResults%20As%20Variant%0A%0Adelimiter%20%3D%20%22%2C%20%22%0ASet%20rg%20%3D%20Range(%22A2%22).CurrentRegion%0ASet%20rg%20%3D%20rg.Offset(1%2C%200).Resize(rg.Rows.Count%20-%201%2C%20rg.Columns.Count)%0An%20%3D%20rg.Rows.Count%0AnData%20%3D%20Application.CountA(rg.Columns(1))%0AvData%20%3D%20rg.Value%0AReDim%20vResults(1%20To%20nData%2C%201%20To%202)%0A%0AFor%20i%20%3D%201%20To%20n%0A%20%20%20%20If%20vData(i%2C%201)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20%2B%201%0A%20%20%20%20%20%20%20%20vResults(k%2C%201)%20%3D%20vData(i%2C%201)%0A%20%20%20%20%20%20%20%20If%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20i%20%26gt%3B%201%20Then%20vResults(k%20-%201%2C%202)%20%3D%20Left%24(s%2C%2032767)%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20s%20%3D%20IIf(vData(i%2C%202)%20%3D%20%22%22%2C%20%22%22%2C%20vData(i%2C%202))%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20If%20vData(i%2C%202)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20s%20%3D%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20Else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20s%20%26amp%3B%20delimiter%20%26amp%3B%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20End%20If%0ANext%0AIf%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%20vResults(k%2C%202)%20%3D%20Left%24(s%2C%2032767)%0A%0Arg.ClearContents%0Arg.Resize(nData%2C%202).Value%20%3D%20vResults%0AEnd%20Sub%3C%2FPRE%3E%0A%3CP%3EPlease%20try%20running%20the%20revised%20macro%20on%20your%20full%20dataset.%20If%20it%20works%2C%20we%20can%20then%20shift%20discussion%20to%20how%20best%20to%20handle%20the%20text%20in%20the%20overflow.%20Perhaps%20additional%20columns%20or%20rows%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757727%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757727%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20sounds%20like%20it%20will%20work.%20I%20will%26nbsp%3Bbe%20able%20to%20try%20it%20in%20a%20couple%20hours%20or%20so%20and%20will%20report%20back.%3C%2FP%3E%3CP%3EAs%20far%20as%20the%20overflow%2C%20additional%20rows%20are%20acceptable.%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757782%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757782%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EI%20revised%20the%20macro%20to%20allow%20up%20to%20200%20more%20rows%20of%20results%20in%20case%20of%20overflow%2C%20as%20well%20as%20up%20to%20165%20characters%20in%20next%20pass%20through%20the%20concatenation%20loop.%20When%20an%20overflow%20situation%20is%20detected%2C%20the%20server%20name%20will%20be%20repeated%20as%20often%20as%20needed%20to%20get%20all%20software%20names%20listed%20on%20additional%20rows.%3C%2FP%3E%0A%3CPRE%3ESub%20Sequelize()%0ADim%20rg%20As%20Range%0ADim%20delimiter%20As%20String%2C%20s%20As%20String%0ADim%20i%20As%20Long%2C%20k%20As%20Long%2C%20n%20As%20Long%2C%20nData%20As%20Long%0ADim%20vData%20As%20Variant%2C%20vResults%20As%20Variant%0A%0Adelimiter%20%3D%20%22%2C%20%22%0ASet%20rg%20%3D%20Range(%22A2%22).CurrentRegion%0ASet%20rg%20%3D%20rg.Offset(1%2C%200).Resize(rg.Rows.Count%20-%201%2C%20rg.Columns.Count)%0An%20%3D%20rg.Rows.Count%0AnData%20%3D%20Application.CountA(rg.Columns(1))%0AnData%20%3D%20nData%20%2B%20200%20'Allow%20for%20servers%20whose%20software%20list%20exceeds%2032%2C767%20characters%0AvData%20%3D%20rg.Value%0AReDim%20vResults(1%20To%20nData%2C%201%20To%202)%0A%0AFor%20i%20%3D%201%20To%20n%0A%20%20%20%20If%20vData(i%2C%201)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20k%20%3D%20k%20%2B%201%0A%20%20%20%20%20%20%20%20vResults(k%2C%201)%20%3D%20vData(i%2C%201)%0A%20%20%20%20%20%20%20%20If%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20i%20%26gt%3B%201%20Then%20vResults(k%20-%201%2C%202)%20%3D%20Left%24(s%2C%2032767)%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20s%20%3D%20IIf(vData(i%2C%202)%20%3D%20%22%22%2C%20%22%22%2C%20vData(i%2C%202))%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20If%20vData(i%2C%202)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20s%20%3D%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20Else%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20s%20%26amp%3B%20delimiter%20%26amp%3B%20vData(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20End%20If%0A%20%20%20%20%0A%20%20%20%20'Overflow%20occurs%20if%20you%20put%20more%20than%20%2032%2C767%20characters%20in%20a%20cell.%20This%20block%20allows%20up%20to%20165%20characters%20(plus%20delimiter)%20in%20next%20pass%20through%20loop.%0A%20%20%20%20If%20Len(s)%20%26gt%3B%2032600%20Then%0A%20%20%20%20%20%20%20%20If%20(i%20%26lt%3B%20n)%20And%20(vData(i%20%2B%201%2C%201)%20%3D%20%22%22)%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20vResults(k%2C%202)%20%3D%20s%0A%20%20%20%20%20%20%20%20%20%20%20%20vResults(k%20%2B%201%2C%201)%20%3D%20vResults(k%2C%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20k%20%3D%20k%20%2B%201%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20End%20If%0ANext%0AIf%20s%20%26lt%3B%26gt%3B%20%22%22%20Then%20vResults(k%2C%202)%20%3D%20Left%24(s%2C%2032767)%0A%0Arg.ClearContents%0Arg.Resize(nData%2C%202).Value%20%3D%20vResults%0AEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757818%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757818%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20have%20done%20it!%20Thank%20you%20for%20your%20dedication%20to%20this%20issue%20of%20mine.%20This%20works%20perfectly.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F374823%22%20target%3D%22_blank%22%3E%40Brad_Yundt%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757828%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757828%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20not%20a%20secret%2C%20what's%20the%20reason%20keep%20list%20of%20server%20software%20in%20so%20long%20strings%20instead%20of%20columns%20cell%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757913%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757913%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20importing%20this%20into%20a%20sharepoint%20webpage%20through%20the%20excel%20app%20and%20if%20I%20kept%20all%20the%20applications%20in%20columns%20then%20some%20of%20the%20servers%20would%20have%20100%2B%20columns.%20I%20am%20positive%20there%20is%20a%20better%20way%20to%20accomplish%20my%20task%20but%20am%20a%20new%20intern%20and%20I%20lack%20the%20knowledge%20to%20do%20so.%20%3A%2F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757984%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757984%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376524%22%20target%3D%22_blank%22%3E%40JayNixon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20see%2C%20thank%20you%20for%20the%20explanation.%20Perhaps%20servers%20in%20columns%20will%20be%20more%20compact%20and%20searchable%2C%20but%20it%20all%20depends%20on%20your%20concrete%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757996%22%20slang%3D%22en-US%22%3ERe%3A%20Concatenating%20column%20B%20values%20if%20left%20adjacent%20cell%20is%20empty%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757996%22%20slang%3D%22en-US%22%3E%3CP%3EYeah%2C%20unfortunately%20I%20am%20working%20with%20such%20a%20large%20amount%20of%20data%20here%20that%20it%20doesn't%20want%20to%20cooperate%20by%20making%20it%20easy%20and%20convenient%20to%20read.%20There%20are%20thousands%20of%20servers%20and%20the%20software%20includes%20everything%20from%20Google%20Chrome%20to%20.net%20framework%20updates%20to%20security%20updates%20for%20various%20tools.%20But%20what%20I%20have%20now%20is%20the%20easiest%20to%20search%20through%20I%20believe.%20I%20can%20query%20the%20inventory%20for%20a%20server%20and%20then%20it%20will%20just%20show%20me%20the%20column(s)%20of%20data%20associated%20with%20it.%20From%20there%20I%20can%20just%20Ctrl%2BF%20to%20search%20more%20specifically.%20Thanks%20for%20trying%20to%20help%20me%20with%20my%20issue.%20I%20appreciate%20it.%20I%20have%20much%20to%20learn!!%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
JayNixon
Occasional Contributor

I need to combine cells in column B if the value in the cell to the left is blank while also deleting the blank cell to the left to close any gaps between cells in Column A. The best way for me to explain this is by showing an example. I need this:

 

Column A             Column B

Test                      This

                             That

                             Other

Test2                    Also

                             This

Test3                    Please

                             Help

                             Me

 

To look like this

 

Column A                    Column B

Test                              This, That, Other

Test2                            Also, This

Test3                            Please, Help, Me

 

 

I am not quite sure how to word my question to search so I apologize if this has been asked many times! :)

37 Replies

@JayNixon 

If you want a formula to return your concatenated text and have Excel 2016 on Office 365 subscription (or Excel 2019), then you may copy down a TEXTJOIN formula:

=TEXTJOIN(",",TRUE,INDEX(B:B,MATCH(D2,A:A,0)):INDEX(B:B,IFERROR(MATCH(D3,A:A,0)-1,MAX(MATCH({"zzzzz",1E+307},B:B,1)))))

@JayNixon 

It could be done with Power Query - query the date, fill down first column, group by it, add column with initial second column as list and extract it with separator

image.png

 

Thanks @Brad_Yundt  for your quick response here. I am trying this formula now. I am a novice when it comes to excel so I have a few questions.

I tried running that formula is column C and the return is #N/A. What do I need to change here?

Is column C the correct column?

 

Thanks in advance.

Thanks for responding so quickly @Sergei Baklan. I am pretty green when it comes to excel but have been working with it extensively in my new position. If you have the time, could you explain Power Query a bit more? I would like to know more about it from someone who has obviously used it.

@JayNixon 

Hi Jay,

there are a solution with help of the follwing macro:

Sub GroupData()
Dim lngRow As Long
Dim lngRowMax As Long
Dim lngz As Long
Dim lngzMax As Long

With Sheet1
.Range("G:H").ClearContents
.Range("G1:H1").Value = .Range("A1:B1").Value
lngz = 2
lngRowMax = .Range("B" & .Rows.Count).End(xlUp).Row

For lngRow = 2 To lngRowMax
If .Range("A" & lngRow).Value <> "" Then
.Range("G" & lngz).Value = .Range("A" & lngRow).Value
.Range("H" & lngz).Value = .Range("B" & lngRow).Value
lngz = lngz + 1
Else
lngzMax = .Range("H" & .Rows.Count).End(xlUp).Row
.Range("H" & lngzMax).Value = .Range("H" & lngzMax).Value & "," & .Range("B" & lngRow).Value
End If

Next lngRow

End With

End Sub

Best regards
Bernd
https://vba-tanker.com/

 

If you prefer a macro to concatenate, then consider:

Sub Sequelize()
Dim rg As Range, targ As Range
Dim delimiter As String, s As String
Dim i As Long, j As Long, n As Long

delimiter = ", "
Set rg = Range("A2").CurrentRegion
Set rg = rg.Offset(1, 0).Resize(rg.Rows.Count - 1, rg.Columns.Count)
n = rg.Rows.Count
j = 1
For i = n To 1 Step -1
    If rg.Cells(i, 1).Value <> "" Then
        rg.Rows(i + 1).Resize(j - 1).EntireRow.Delete
        If rg.Cells(i, 2).Value <> "" Then s = rg.Cells(i, 2).Value & delimiter & s
        If s <> "" Then rg.Cells(i, 2).Value = Left(s, Len(s) - Len(delimiter))
        j = 1
        s = ""
    Else
        j = j + 1
        If rg.Cells(i, 2).Value <> "" Then s = rg.Cells(i, 2).Value & delimiter & s
    End If
Next
End Sub

@JayNixon 

The formula was assuming that you already had the column A values listed as in your initial post.

 

When you subsequently changed your question, I wrote a macro to do the new  request.

 

The attached workbook shows both the macro and the formula.

Thank you @Brad_Yundt. I am trying to test this now on my actual worksheet and the only problem I am having is that the sheet is 260,000 rows and my computer will freeze every time I try anything. 

@JayNixon 

Please post a small sample workbook showing your actual data layout.

 

I propose to use array transfer for speed, and want to get the code right the first time. I therefore need to know the layout, extent of data and complicating factors (merged cells, worksheet protection, adjacent columns that must not be deleted, blank rows, etc).

 

Brad

@JayNixon 

Power Query - you may start from Getting Started with Get & Transform in Excel ,it gives the main idea. Technology requires some time to invest, but you may start doing something practical from very first steps.

 

For this sample you may open the query (Data->Queries $ Connections, double click on query in the right pane) and check step by step what it's doing.

Going somewhat out on a limb here without a sample workbook to look at. I revised the code to use array transfer into VBA and back. It will run a lot faster as a result.

Sub Sequelize()
Dim rg As Range
Dim delimiter As String, s As String
Dim i As Long, k As Long, n As Long, nData As Long
Dim vData As Variant, vResults As Variant

delimiter = ", "
Set rg = Range("A2").CurrentRegion
Set rg = rg.Offset(1, 0).Resize(rg.Rows.Count - 1, rg.Columns.Count)
n = rg.Rows.Count
nData = Application.CountA(rg.Columns(1))
vData = rg.Value
ReDim vResults(1 To nData, 1 To 2)

For i = 1 To n
    If vData(i, 1) <> "" Then
        k = k + 1
        vResults(k, 1) = vData(i, 1)
        If s <> "" Then
            If i > 1 Then vResults(k - 1, 2) = s
        End If
        s = IIf(vData(i, 2) = "", "", vData(i, 2))
    Else
        If vData(i, 2) <> "" Then
            If s = "" Then
                s = vData(i, 2)
            Else
                s = s & delimiter & vData(i, 2)
            End If
        End If
    End If
Next
If s <> "" Then vResults(k, 2) = s

rg.ClearContents
rg.Resize(nData, 2).Value = vResults
End Sub

I apoligize for the delay in response here @Brad_Yundt. I was having trouble with my laptop because excel was crashing often. I will attach a very small sample of the data I am working with. I am basically looking at all the software/applications installed on all the servers in my domain. I want all the applications belonging to each server to be in one cell block and be separated by a comma.

 

ServerA           IE,Chrome,Windows Update, Intel driver, Edge, etc...

 

ServerB           Chrome, Nvidia GPU Driver, Edge, etc....

 

 

Rather than what it currently is

 

ServerA           IE

                        Chrome

                       Windows Update

                        Intel driver

                        Edge

                        etc...

 

Server B           Chrome

                      Nvidia GPU Driver

                      Edge

                      etc....

I just bookmarked this. I will read it on my next break. Thank you Sergei.

My most recent macro is working on your test workbook. I installed the code, added a button to call it in the attached workbook so you may test. The duplicate data off to the right is so I can easily restore the original condition.

 

Brad

I just ran it on my actual worksheet and it deleted everything below row 1. I may not be executing this properly. I went to view macros, create, pasted in the macro from above, saved it, then ran that macro. I assume this is how I am supposed to do it but maybe I am incorrect. Also my actual worksheet has 260,000 rows of data but that shouldn't affect it, correct?

@JayNixon 

Here is the Power Query version. Applications are sorted alphabetically in the list.

I have never used Power Query. This is something I will have to research more as I haven't the slightest clue how to utilize it. I see it works beautifully. I will start my reading now.

@JayNixon 

Macro which Brad suggested works fine, but if you never used VBA it also takes time to learn how it works. VBA is much more universal, but, from my point of view, Power Query is more suitable for data transform tasks.

@JayNixon 

The macro assumes your data starts in row 2 and that header labels are in row 1. It further assumes that you have no blank lines in your data, and that there are only two columns of data.

 

Your question said that you wanted to start with two columns of data in columns A and B, then end up with two columns of compacted results in columns A and B. That's what the macro does.

 

The third from the last statement in the macro deletes the existing data (except header labels). The next to last statement puts the compacted results starting in cell A2. If you want them moved elsewhere, that statement is easily changed.

 

I made 6270 copies of your data, filling the sheet past row 260000 and ran the macro. It completed work in less than a second.

I feel like I am missing something very simple that is just going over my head here. My data headers "ComputerName"in column A and "Application" in column B are in row 1. Data starts in row 2. Column B has no blank cells but Column A has many blank cells. I had deleted the duplicate server names. To me, it looks almost identical to the sample I submitted.

For whatever reason, when I run the macro it just deletes all the data. I ran the script in the sample I gave you. It worked there. It will not work on my actual sheet. It hangs for a second or so then just deletes everything. I am sorry.

I wish I could understand this better and apologize if it feels like you are talking to a 5 year old! lol.

If you select column A with your raw data, how many values are there? It should say something like Count: 6267 at the right of the status bar at the bottom of the application window.

image.png

Currently 235493 entries on column A. @Brad_Yundt 

Although 90% or more are empty cells. I am not sure why they are registering as entries if they are empty.

@JayNixon 

Might you have empty strings or spaces in those "blank" cells? If you do, the macro won't work right.

You can test whether a cell is truly blank using a formula like:

=ISBLANK(A2)

My guess is that many of your column A cells look blank but actually contain an invisible value, such as a single quote, space, non-breaking space, Tab or Carriage Return character.

I formatted the empty cells and tested them with the =isblank and they all came up false, except for of course the cells with actual values. Although after deleting that =isblank column I still was unable to get the macro to run correctly. It is still deleting all the data in the worksheet. I am not sure what I am doing wrong. Will troubleshoot a bit more but I thought you might want an update. I also checked column B for blanks and came up with none as well. Thanks again Brad.

Here is a couple screenshots of the macro with a before and after running.

@Brad_Yundt 

@JayNixon,

I would like test my code on your actual workbook. It's OK if you replace all the data with the letter "x" as long as you can reproduce the problem. You can post a workbook in this thread, or you could email it to me at first initial last name at my ISP, which is alum dot mit dot edu. I would then like to try reproducing the problem. Fixing the problem is easy if I can reproduce it.

 

It's possible that there is a limitation of Excel VBA present in your version of Excel that is not in mine. All my testing so far has been on 64-bit Excel 2016/Office 365 running on Windows 10--but I have other versions available for testing (both Mac and Windows, 32-bit and 64-bit, 2007 to date).

 

Please tell me:

Which version of Excel do you use, Mac or Windows?

If Windows, is 2007, 2010, 2013, 2016 or 2019?

Is it 32-bit or 64-bit?

I am currently running on Windows 7 and using MSOffice 365 ProPlus ver. 16.0.9126.2315

I have found that if I run the macro on smaller portions of data, it will run just fine. I am most the way through my document by now.

Thanks for sending me the file. I can reproduce the problem with my Excel 2016/Office 365 64-bit.

 

Excel cells can hold a maximum of 32,767 characters. Your problem server has 86,510 characters worth of software. I am guessing an overflow occurs that results in the loss of your data.

 

To test this hypothesis, I modified the code to truncate the software list to the first 32,767 characters. Now the macro seems to work.

Sub Sequelize()
Dim rg As Range
Dim delimiter As String, s As String
Dim i As Long, k As Long, n As Long, nData As Long
Dim vData As Variant, vResults As Variant

delimiter = ", "
Set rg = Range("A2").CurrentRegion
Set rg = rg.Offset(1, 0).Resize(rg.Rows.Count - 1, rg.Columns.Count)
n = rg.Rows.Count
nData = Application.CountA(rg.Columns(1))
vData = rg.Value
ReDim vResults(1 To nData, 1 To 2)

For i = 1 To n
    If vData(i, 1) <> "" Then
        k = k + 1
        vResults(k, 1) = vData(i, 1)
        If s <> "" Then
            If i > 1 Then vResults(k - 1, 2) = Left$(s, 32767)
        End If
        s = IIf(vData(i, 2) = "", "", vData(i, 2))
    Else
        If vData(i, 2) <> "" Then
            If s = "" Then
                s = vData(i, 2)
            Else
                s = s & delimiter & vData(i, 2)
            End If
        End If
    End If
Next
If s <> "" Then vResults(k, 2) = Left$(s, 32767)

rg.ClearContents
rg.Resize(nData, 2).Value = vResults
End Sub

Please try running the revised macro on your full dataset. If it works, we can then shift discussion to how best to handle the text in the overflow. Perhaps additional columns or rows?

It sounds like it will work. I will be able to try it in a couple hours or so and will report back.

As far as the overflow, additional rows are acceptable.@Brad_Yundt 

Solution

@JayNixon

I revised the macro to allow up to 200 more rows of results in case of overflow, as well as up to 165 characters in next pass through the concatenation loop. When an overflow situation is detected, the server name will be repeated as often as needed to get all software names listed on additional rows.

Sub Sequelize()
Dim rg As Range
Dim delimiter As String, s As String
Dim i As Long, k As Long, n As Long, nData As Long
Dim vData As Variant, vResults As Variant

delimiter = ", "
Set rg = Range("A2").CurrentRegion
Set rg = rg.Offset(1, 0).Resize(rg.Rows.Count - 1, rg.Columns.Count)
n = rg.Rows.Count
nData = Application.CountA(rg.Columns(1))
nData = nData + 200 'Allow for servers whose software list exceeds 32,767 characters
vData = rg.Value
ReDim vResults(1 To nData, 1 To 2)

For i = 1 To n
    If vData(i, 1) <> "" Then
        k = k + 1
        vResults(k, 1) = vData(i, 1)
        If s <> "" Then
            If i > 1 Then vResults(k - 1, 2) = Left$(s, 32767)
        End If
        s = IIf(vData(i, 2) = "", "", vData(i, 2))
    Else
        If vData(i, 2) <> "" Then
            If s = "" Then
                s = vData(i, 2)
            Else
                s = s & delimiter & vData(i, 2)
            End If
        End If
    End If
    
    'Overflow occurs if you put more than  32,767 characters in a cell. This block allows up to 165 characters (plus delimiter) in next pass through loop.
    If Len(s) > 32600 Then
        If (i < n) And (vData(i + 1, 1) = "") Then
            vResults(k, 2) = s
            vResults(k + 1, 1) = vResults(k, 1)
            s = ""
            k = k + 1
        End If
    End If
Next
If s <> "" Then vResults(k, 2) = Left$(s, 32767)

rg.ClearContents
rg.Resize(nData, 2).Value = vResults
End Sub

You have done it! Thank you for your dedication to this issue of mine. This works perfectly. @Brad_Yundt 

@JayNixon 

If not a secret, what's the reason keep list of server software in so long strings instead of columns cell?

@Sergei Baklan 

I am importing this into a sharepoint webpage through the excel app and if I kept all the applications in columns then some of the servers would have 100+ columns. I am positive there is a better way to accomplish my task but am a new intern and I lack the knowledge to do so. :/

@JayNixon 

I see, thank you for the explanation. Perhaps servers in columns will be more compact and searchable, but it all depends on your concrete data.

Yeah, unfortunately I am working with such a large amount of data here that it doesn't want to cooperate by making it easy and convenient to read. There are thousands of servers and the software includes everything from Google Chrome to .net framework updates to security updates for various tools. But what I have now is the easiest to search through I believe. I can query the inventory for a server and then it will just show me the column(s) of data associated with it. From there I can just Ctrl+F to search more specifically. Thanks for trying to help me with my issue. I appreciate it. I have much to learn!!

@Sergei Baklan 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies