Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default userform label set enter

I have a userform label set to a specific value copied from two cells.. can I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default userform label set enter

Try

Me.Label5 = Range("e12").Value & vbCrLf & Range("e13").Value

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Tue, 15 Dec 2009 12:18:01 -0800, Alberto Ast
wrote:

I have a userform label set to a specific value copied from two cells.. can I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default userform label set enter

Try concatenating vbLf between them...

Me.Label5 = Range("e12").Value & vbLf & Range("e13").Value

--
Rick (MVP - Excel)


"Alberto Ast" wrote in message
...
I have a userform label set to a specific value copied from two cells.. can
I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default userform label set enter

try this
Me.Label5 = Range("e12").Value & vbcrlf & Range("e13").Value


"Alberto Ast" wrote:

I have a userform label set to a specific value copied from two cells.. can I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default userform label set enter

One more way for interest, if the cells are contiguous -

Dim dObj As DataObject
Set dObj = New DataObject
Range("A1:C3").Copy

dObj.GetFromClipboard
Me.Label1 = dObj.GetText(1)
Application.CutCopyMode = False

If only a few cells or non-contiguous stick with what you've got.

Regards,
Peter T



"Alberto Ast" wrote in message
...
I have a userform label set to a specific value copied from two cells.. can
I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default userform label set enter

Thanks it works great but I have one question...
What is the difference among

vbCr, vbCrLf and vbLf?


"Rick Rothstein" wrote:

Try concatenating vbLf between them...

Me.Label5 = Range("e12").Value & vbLf & Range("e13").Value

--
Rick (MVP - Excel)


"Alberto Ast" wrote in message
...
I have a userform label set to a specific value copied from two cells.. can
I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456


.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default userform label set enter

I'm not completely sure of your question; see if this answers it. These are
predefined constants in VB... vbCr is a Carriage Return character (ASCII
13), vbLf is a Line Feed character (ASCII 10) and vbCrLf is two
characters... a Carriage Return followed by a Line Feed. You can think of
this last one like this...

vbCrLf <== vbCr & vbLf

Generally, for text files, the vbLf character is used as the "newline"
character in UNIX and Linux operating systems; the vbCr character is used as
the "newline" character in Mac computers and the vbCrLf combination of
characters is used as the "newline" character sequence in Windows systems.
For whatever reason, Microsoft decided to use vbLf for "newlines" in Excel
cell text, MessageBoxes, Labels, etc., contrary to their own established
vbCrLf convention used in Windows text files.

--
Rick (MVP - Excel)


"Alberto Ast" wrote in message
...
Thanks it works great but I have one question...
What is the difference among

vbCr, vbCrLf and vbLf?


"Rick Rothstein" wrote:

Try concatenating vbLf between them...

Me.Label5 = Range("e12").Value & vbLf & Range("e13").Value

--
Rick (MVP - Excel)


"Alberto Ast" wrote in message
...
I have a userform label set to a specific value copied from two cells..
can
I
have an enter betwen both cells value?

Me.Label5 = Range("e12").Value & Range("e13").Value

I would like it to show

ECR
123456

where
ECR is the value in cell c12
123456 is the value in cell e13

it actualy shows
ECR123456


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
useform label enter Alberto Ast[_2_] Excel Discussion (Misc queries) 1 December 16th 09 01:26 AM
Userform - Label Looping through Excel Programming 4 May 27th 09 08:20 PM
Userform Label Steve[_9_] Excel Discussion (Misc queries) 7 October 29th 07 09:51 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Userform blinking label Ed Excel Programming 2 July 17th 04 12:24 AM


All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"