VBA Query

%3CLINGO-SUB%20id%3D%22lingo-sub-1604843%22%20slang%3D%22en-US%22%3EVBA%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1604843%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20some%20VBA%20code%20that%20allows%20me%20to%20select%20multiple%20items%20in%20a%20drop%20down%20list%20and%20populate%20the%20data%20in%20a%20single%20cell.%20The%20code%20works%20in%20multiple%20columns.%20I%20have%20attached%20a%20screenshot.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20am%20trying%20to%20do%20is%20add%20a%20Char(10)%20'within%20cell'%20line%20break%20-%20so%20that%20each%20selection%20goes%20to%20a%20new%20line%20within%20the%20same%20cell%20(rather%20than%20append).%20No%20matter%20what%20I%20try%2C%20i%20can't%20seem%20to%20get%20it%20to%20work.%20Any%20ideas%20what%20I%20am%20missing%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPip%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202020-08-21%20at%204.01.46%20PM.png%22%20style%3D%22width%3A%20839px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F213847i59B4AF1AFEF0FFDF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Screen%20Shot%202020-08-21%20at%204.01.46%20PM.png%22%20alt%3D%22Screen%20Shot%202020-08-21%20at%204.01.46%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1604843%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605191%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605191%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F763636%22%20target%3D%22_blank%22%3E%40Piplinson%3C%2FA%3E%26nbsp%3BPerhaps%20this%20link%20will%20help%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fexcelchamps.com%2Fvba-new-line%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexcelchamps.com%2Fvba-new-line%2F%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605221%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20Query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605221%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F763636%22%20target%3D%22_blank%22%3E%40Piplinson%3C%2FA%3E%3C%2FP%3E%3CP%3EInteresting%20code%2C%20but%20I%20couldn't%20find%20where%20the%20line-feed%20is%20being%20inserted.%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20I%20found%20was%3C%2FP%3E%3CP%3E%22%26nbsp%3B%20%26nbsp%3B%20%7C%26nbsp%3B%20%26nbsp%3B%20%22%3C%2FP%3E%3CP%3Ebut%20that%20may%20be%20my%20failing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20basic%20check%20on%20the%20worksheet%20is%20has%20your%20cell%20alignment%20been%20set%20to%3C%2FP%3E%3CP%3E'Wrap%20Text%22%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi all

 

I have some VBA code that allows me to select multiple items in a drop down list and populate the data in a single cell. The code works in multiple columns. I have attached a screenshot. 

 

What I am trying to do is add a Char(10) 'within cell' line break - so that each selection goes to a new line within the same cell (rather than append). No matter what I try, i can't seem to get it to work. Any ideas what I am missing?

 

Pip

 

Screen Shot 2020-08-21 at 4.01.46 PM.png

 

2 Replies
Highlighted

@Piplinson Perhaps this link will help

https://excelchamps.com/vba-new-line/ 

Highlighted

@Piplinson

Interesting code, but I couldn't find where the line-feed is being inserted. 

All I found was

"    |    "

but that may be my failing.

 

One basic check on the worksheet is has your cell alignment been set to

'Wrap Text"?