+ Reply to Thread
Results 1 to 2 of 2

How to display values in multiple lines if multiple checkbox's are selected?

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    bath
    MS-Off Ver
    Excel 2010
    Posts
    16

    How to display values in multiple lines if multiple checkbox's are selected?

    In my userform I have a list of check box's that can be selected. Currently if more than one is selected, they will appear in the spread sheet in the same line one after another with a space between them. How do I make it so they either appear with a comma appearing after each, or so the next value appears on the next line below?

    Current code

    If CheckBox1.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox1.Caption
    If CheckBox2.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox2.Caption
    If CheckBox3.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox3.Caption
    If CheckBox4.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox4.Caption
    If CheckBox5.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox5.Caption
    If CheckBox6.Value = True Then ws.Cells(iRow, 2).Value = ws.Cells(iRow, 2).Value & " " & CheckBox6.Caption

    Spreadsheet current cell appearence if all 6 are selected ' Chinnook EH101 Lynx Puma Sea King Fixed Wing'

    Required appearence:
    Chinnook
    EH101
    Lynx
    Puma
    Sea King
    Fixed Wing

    Or appeareed as a drop down list in the cell
    Last edited by kjshep; 09-10-2012 at 09:22 AM.

  2. #2
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Belfast, N. Ireland
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: How to display values in multiple lines if multiple checkbox's are selected?

    Kjshep,

    Is this something like what you are looking for? Does the list have to be without spaces?

    Attachment 179515

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1