• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How do I link commandbuttons to combobox selection?

ERG1982

New Member
Hi all,

I need to combine the action of a command button to be dependent on the selection in the Combo Box in order to fill the cell with the selection that the combo box refers to.

For instance, if I have three A columns,

A2: Shoes
A3: Socks
A4: Gloves

And two rows in B and C:

B1: Video
C1: Article

I have a userform where my command buttons are "Started" and "Published".

In my userform, the ComboBox lists Shoes, Socks, Gloves

Clicking Started or Published would place an "S" or a "P" in a cell. I want the cell that is filled with an S or P to be dependent on my ComboBox selection.

So if I choose Socks and clicked Started, an S would appear in B3. If I click Shoes in the ComboBox, then click the same Started command button, an "S" would appear in B2.

Do you know what coding I should use to make this happen, and if there's a shortcut or trick if I have a long list of columns?



Thanks!!
 
I've condensed what I'm working with to the simple example above.

Thank you for your help!
 

Attachments

  • Template Test Area.xlsm
    90.2 KB · Views: 8
ERG1982
1) There are some ActiveX-components ... sorry not for me.
... only read-only.
2) .. cause previous or something else, while open that file
Screen Shot 2018-12-26 at 20.15.41.png
3) Which names to which row something should mark?
You have there total two rows to choose (50/50).
 
So if I select Article from the drop down, then click Start, an S needs to appear in B3. If I select Video from the drop down, then click the same Start button, an S needs to appear in B2.

However, the main file I'm working with has many more selections in the combobox range, the amount of commandbuttons, and the various columns, so I need to be able to use the same buttons to fill in multiple cells depending on the selection in the combobox by clicking on commandbuttons.
 
ERG1982
... the drop down ... hmm? ... where?
In my userform, the ComboBox lists Shoes, Socks, Gloves
... and the ComboBox seems to be empty or ActiveX-component...
>
After You've made Your selections,
You would match those values to 'Completions'-sheet
(You'll get row and column)
and
insert needed result there.
 
Sorry that the sheet wasn't working right. Not sure what happened there. Would you be able to go into more detail @vletm ? I fear I'm not asking the question correctly. So no more made up examples. Here's what I'm trying to do exactly.

The combobox will list a bunch of product SKUs. Those product SKUs make up each row on my workbook. So there are 86 rows listing an individual number, ie: 176584. So when I activate the userform, there is a combobox that contains all the different SKU numbers. Below that are different command buttons.

If I click into the combobox, the coding allows me to select one of the SKUs because the range is B2:B87, each B containing a different SKU number. Then I have command buttons for different tasks. So one button says Video Started and another says Video Finished. When you click a started button, S appears next to the SKU number in the C column. If you click Finished, it becomes an F.

I need to select a SKU from the combobox list and click those same buttons to fill respective cells with an S or an F. If I select 176584 from the combobox, the command button knows to place a letter in the corresponding C cell next to that SKU. If I select a different SKU from the same combobox, like 366211, and click the exact same commandbutton, then an S or an F will appear in the corresponding C cell next to 366211.

Is this doable??
 
ERG1982
Questions are always welcome.
Your example needs also a sample file,
which has those Your uses 'cases' and terms.
Without those ... should do this as my eyes are closed
... it's challenge to write same time
and some/many cases my vision would be same/different.
If I do this my way/vision then You would change Your master plan - hmm?
 
Back
Top