User form and concatenated values

marcusforce

Board Regular
Joined
May 3, 2004
Messages
52
Hi,

I'm working on a user form where the user is picking a text choice in a combobox(1).
When this is done a counter adds 1 to the variable counterl.

This is where I got a bit stuck:
I want to set a new variable where counterv= combobox1.value AND counterl.value
Then I want to show the counterl value in textbox1.
Help with this bit of coding much appreciated.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

im not too hot on forms,

but can you now just use code

counterv = combobox1.value & counterl.value

then textbox1.value = counterv

let me know if this works?!!
thanks
 
Upvote 0
this code works when not in a userform :-

cxan you try replacing "hello" and "hello2" with your counterl.value and combobox1.value ??

by assigning them to variables rather than not trying to concatenate them directly???

have a go

Sub trst()

counter = "hello"
counter2 = "hello2"

counter3 = counter & counter2

MsgBox (counter3)


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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