if combo box selection on a userform matches an item found in a separate table, then...

kbishop94

Active Member
Joined
Dec 5, 2016
Messages
478
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a combo box on a userform that is populated with the list items that are found within a named table range called "PrimaryCustomers":
Capture1873.jpg Capture1877.jpg


What I am trying to figure out is some code that if the selection that is made from the combo box ALSO happens to match one of the names that are present in a second named table range (named: "SecondaryCustomers"), then it will do... <will add some value to a cell on a worksheet>

the second named table range: "SecondaryCustomers"
Capture1874.jpg



so if the selection made from the combo box was "Customer 8", and since that selection also matches what is found in the named table range "SecondaryCustomers", then it would populate a some value back on different worksheet.

suggestions?

Thank you
 
also (I should have included this in my original post), my current code looks like this:

VBA Code:
If frmIncidentEntry.cboCustomer.value = "" Then Cells(llRow, 7).value = "-" Else Cells(llRow, 7).value = frmIncidentEntry.cboCustomer.value             ' (4) customer associated with Incident


my current code only takes the selected item from the list, and as long as what was selected wasn't a "-", or "", then it populates the selection back on my worksheet....

what I am needing is code that expands on that 'If' statement and also looks within the second table ("SecondaryCustomers") to see if there is a match. Thanks again
 
Upvote 0

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