Excel User form and concatenated values from Mr Excel



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

User form and concatenated values
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

marcusforce
Board Regular


Joined: 03 May 2004
Posts: 20
Location: Stockholm
Flag: Sweden

Status: Offline

 Reply with quote  

User form and concatenated values

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.

Post Mon May 10, 2004 2:20 pm 
 View user's profile Send private message

stickboy
Board Regular


Joined: 24 Jun 2002
Posts: 79

Flag: Blank

Status: Offline

 Reply with quote  

Re: User form and concatenated values

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

Post Mon May 10, 2004 2:49 pm 
 View user's profile Send private message

marcusforce
Board Regular


Joined: 03 May 2004
Posts: 20
Location: Stockholm
Flag: Sweden

Status: Offline

 Reply with quote  

Nope, that seems like the most intuitive solution, but that concatenation doesn't work.

Post Mon May 10, 2004 2:58 pm 
 View user's profile Send private message

stickboy
Board Regular


Joined: 24 Jun 2002
Posts: 79

Flag: Blank

Status: Offline

 Reply with quote  

Re: User form and concatenated values

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

Post Mon May 10, 2004 3:05 pm 
 View user's profile Send private message

marcusforce
Board Regular


Joined: 03 May 2004
Posts: 20
Location: Stockholm
Flag: Sweden

Status: Offline

 Reply with quote  

That was a good piece of advice, works now, thanks!

Post Mon May 10, 2004 3:39 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.