+ Reply to Thread
Results 1 to 16 of 16

Command button code that fills two combo box values and a toggle in cell

  1. #1
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Command button code that fills two combo box values and a toggle in cell

    Hi,

    I am looking for VB code for command button that fills two combo box
    values and a toggle value (Y/N) behind each other in one cell.

    Bart
    Excel 2003
    Last edited by vdongen; 10-05-2010 at 12:03 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    hi vdongen
    can you please expand on what you mean?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi it is actually like this:

    I have to cells with data validation list=...
    Then I have one toggle button that can have value Y or N.

    Now, I am looking for a command button code that fills both three values into a cell range that I select with the mouse. Result is merged.

    Choice 1 = Paris
    Choice 2 = Car
    Driver? Yes

    Push button, asked for cell range then result:

    Cell B1 - B5:
    Paris Car Y

    Bart

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    thik i know what you need
    could you please attach a sample workbook?

  5. #5
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi Pike, I have attached. The explanation is inside.
    Attached Files Attached Files

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    hi vdongen
    merging cell will cause problems.

  7. #7
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    with the previous code (with comboboxes) it worked fine, you can still see two samples

    I only wants to have the values from the Validation=list cells rather then comboboxes

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    Can you part with the merge cells

  9. #9
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Pike, sorry, I don't know what you mean.

    Here is the code I used for the combobox model that works fine, but I only want the source from the dropdown lists instead of combo.

    Please Login or Register  to view this content.
    Last edited by pike; 10-02-2010 at 10:16 PM. Reason: correct tags

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi vdongen
    can you please edit your last post and add code tags
    Last edited by pike; 10-02-2010 at 10:19 PM.

  11. #11
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    dude if you set the driver toggle button linked cell value to n3 then
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi Pike, thanks it works. I can fine tune when I know more about the solution you give me.

    Two questions about text position:

    You used " " for a space. What is the "enter" code, so the contents goes to the second line of the cell range? I tried to find in the VB Help but failed to get the understanding.

    Sample:

    Text A
    Driver Text B Beamer

    Possible to use align commands so text is placed either "centered", then on second line "left" / "centered" / "right"?

  13. #13
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi vdongenthe
    new line is
    Please Login or Register  to view this content.
    and alignment
    Please Login or Register  to view this content.
    but the merged cells will cause problems

  14. #14
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Understood.

    The merged cells contents is from two cell values D3 and H3.
    Possible to replace the value for the last with the value that is asked by the user? (Same as: "Select A Range", but now "What is your location?" (input limited to 15 characters).

    Btw, If I cancel the current "Select A Range" question then I get an VB error. I need an Ifthen statement as far as i know.

  15. #15
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Command button code that fills two combo box values and a toggle in cell

    Hi vdongen,
    would increasing the row height work?

  16. #16
    Forum Contributor
    Join Date
    10-01-2010
    Location
    Jakarta
    MS-Off Ver
    Excel 2003
    Posts
    101

    Re: Command button code that fills two combo box values and a toggle in cell

    Yes, that basically work, but it makes the sheet very high as there are many employees (you can unhide the rows).

    I am still looking for user input question solution as not all values can be listed using validation/list.

    Btw, canceling the current Range selection question gives an error.

+ 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