-
label caption
I'm trying to enter a number display in a label into a textbox. For some reason, its entering it as a text. The code I'm using is below. I need to enter the number display in the label into textbox (as a number), so I can enter it into the worksheet. Can someone assist. Thanks
[VBA]Textbox1.Value = Label16.Caption[/VBA]
-
[VBA][A1]=label16.caption[/VBA]
-
forgive me...but what is [A1]?
Sorry I should have mention, this label and textboxes are on a userform
-
ok...I think I discovered the source of the error. this code..
[vba]Cells(ActiveCell.Row, 95)[/vba]
is storing the number in the textbox as a text. Its also storing the number into the sheet as a text. So I guess my question, now, is how do I store the value as a number and not a text?
-
[A1]=Range("A1")=Cells(1, 1)
A caption and a textbox are strings. What is the value of your label caption?
[VBA]Range("A1").Value = Label16.Caption[/VBA]
You can use CInt(), CDbl(), CLng(), if you like.
-
You'll have to format cells(j,95) to 'general' (in any case not 'text/string')
Excel interprets every number automatically as number if you write it into a worksheet, no matter whether is has been presented as a string or not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules