Multiline / Newline

Cyril Beki

Board Regular
Joined
Sep 18, 2021
Messages
57
Office Version
  1. 2016
Platform
  1. Windows
Hello expert,

I have 2 listboxes (txtActionby & Listbox 1)
Listbox 1 will show the added data
The txtActionby Listbox data is depend upon txtSection.
Once the Add or Update button is pressed, the output of txtActionby in sheet and listbox1 will show "A,B,C etc" (Separated with comma)
Things i would like to achieve is, instead of separated by comma, i would like the output in sheet to be in multiline / newline (Refer image for better references)

Kindly, download the xlsm file below
Passdown2 selamanya ubah 99.9%.xlsm
 

Attachments

  • dasdsa.PNG
    dasdsa.PNG
    20.4 KB · Views: 11
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Have you tried change
Rich (BB code):
If txtActionby.Selected(i) Then strActionBy = IIf(strActionBy = "", txtActionby.List(i), strActionBy & ", " & txtActionby.List(i)) ' There is a space after comma for readability

into vblf
If txtActionby.Selected(i) Then strActionBy = IIf(strActionBy = "", txtActionby.List(i), strActionBy & vblf & txtActionby.List(i)) ' There is a space after comma for readability
 
Upvote 0
Solution
Have you tried change
Rich (BB code):
If txtActionby.Selected(i) Then strActionBy = IIf(strActionBy = "", txtActionby.List(i), strActionBy & ", " & txtActionby.List(i)) ' There is a space after comma for readability

into vblf
If txtActionby.Selected(i) Then strActionBy = IIf(strActionBy = "", txtActionby.List(i), strActionBy & vblf & txtActionby.List(i)) ' There is a space after comma for readability
Work like charm !! Thank you sir
 
Upvote 0

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top