View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Label = whole number - How do I set this?

Bafa,
If you want what appears in the cell, use the .Text property.
If you want the actual value stored in the cell, use the .Value property
Label2.Caption = Worksheets("Data").Range("j20").Text

Or you can format the .Value how you wish
Label2.Caption = Format(Worksheets("Data").Range("j20").Value,"0"

NickHK

"Bafa" wrote in message
...

Private Sub UserForm_Initialize()
Label2.Caption = Worksheets("Data").Range("j20").Value
End Sub

I am using this to draw calculated data from my worksheet and paste
into my UserForm. I set my work sheet cell J20 up to use whole numbers
only, but when my UserForm calls the data up it is still being told
decimal values. Instead of 125.5 showing up in my user form I want to
see just 125 How can I do this please?

Also any suggested reading web sites for someone just wetting their
feet in this?


--
Bafa
------------------------------------------------------------------------
Bafa's Profile:

http://www.excelforum.com/member.php...o&userid=37748
View this thread: http://www.excelforum.com/showthread...hreadid=573620