Concatenation depending on ComboBox-Value

Desperation

New Member
Joined
Mar 12, 2014
Messages
17
Hey guys,
I have this project I’m currently working on and would need some advice on how to implement a certain concatenation.

So I have a UserForm (frml_1) which serves as an input mask for the user. The user can choose options based on 4 ComboBoxes on this UserForm:

  • ComboBox cb_Workers to choose a worker ==> data in worksheet “Workers”
  • ComboBox cb_Case to choose a case ==> data in worksheet “Cases”
  • ComboBox cb_Class to choose a class ==> data in worksheets “MR1 to MR5”
  • ComboBox cb_Index to choose an index ==> data in worksheet “Cases”

All these selections are written to a worksheet called “Summary” in order to display the choices the user made.
Now my second UserForm (frml_Test1) activates after all choices have been made and the Accept Button on UserForm frml_1 has been clicked. It serves as a Questionnaire. There are different questions on different worksheets (“Questions1-6”) and depending on the cb_Case- value selected previously, the questions are different. This all works fine (thanks again to bertie who helped me a lot!).

Now what I would need to realize is the following:
The first two questions, which are used for this Questionnaire, need to be concatenated with the value of the class, which has been chosen previously on UserForm frml_1.

For example the user makes the following selections:


  • Worker 1 = Firstname1, Surname 1 (the workers category is displayed in the “category”- TextBox, which is MR1)
  • Case “New”
  • Class “1”
  • Index doesn’t matter, but let’s take “Standard”

Now that case "New" has been chosen, the UserForm frml_Test1 will use the Questions from the worksheet "Question1" for the Questionnaire. Because "class 1" has been chosen,
question 1 (in worksheet "Question1") would have to be concatenated with the value in worksheet "MR1" (cell B3). Question 2 (in worksheet "Question1") should be concatenated with the bonusvalue in worksheet "MR1" (cell C3).
So I probably need a routine, which checks the ComboBox cb_Class what class has been chosen, search the corresponding worksheet for the value and concatenate this value with the Question being used...
It’s probably really hard to follow my weird description, maybe if someone has the time take a quick look at my attached file it will get clearer... Anyway, I thought at least I’ll try to write down my problem in order to get some helpful suggestions, which would be highly appreciated.

Link to file: https://dl.dropboxusercontent.com/u/84440277/Excel/File_D.xlsm

Best wishes
Des
 
Rich (BB code):
      'DO WE HAVE AN EMPTY CELL?
      If .Value = vbNullString And rowCounter = 3 Then
         '
         'do something
         '
      ElseIf .Value = vbNullString Then
         MsgBox "Questionnaire finished, press OK for evaluation", vbInformation _
         + vbOKOnly, "Finished"
        frml_Test1.cb_Next.Caption = "Finish"
       
      Else
         Me.TextBox1.Text = .Value
      End If

Perfect, this should do it!
Again, thank you very much Bertie, you helped me a lot ;)!

Have a nice weekend.
Des
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,216,108
Messages
6,128,872
Members
449,475
Latest member
Parik11

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