ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Textbox - Shape (https://www.excelbanter.com/excel-programming/406542-textbox-shape.html)

Jarle

Textbox - Shape
 
To input text i textbox I use:
..Shapes("txtbox").TextFrame.Characters.Text = Txtstring

1) If txtstring is a date or number. Can I input as date or number format?
(Replace characters.text)

2) If txtstring is i.e. "2". I want to load variable 2 (as number) into
variable k. (How to convert "2" (string) to 2(number)).

3) Same as 2 but with dates

Thank you!


JLGWhiz

Textbox - Shape
 
the text in a textbox when used as a value is a string variant data type. To
get it to act as a number you would have to use one of the conversion
functions like CLng, CInt, CDbl, etc.

"Jarle" wrote:

To input text i textbox I use:
.Shapes("txtbox").TextFrame.Characters.Text = Txtstring

1) If txtstring is a date or number. Can I input as date or number format?
(Replace characters.text)

2) If txtstring is i.e. "2". I want to load variable 2 (as number) into
variable k. (How to convert "2" (string) to 2(number)).

3) Same as 2 but with dates

Thank you!


Jarle

Textbox - Shape
 
Perfect. Exactly what I was looking for!

JLGWhiz skrev:

the text in a textbox when used as a value is a string variant data type. To
get it to act as a number you would have to use one of the conversion
functions like CLng, CInt, CDbl, etc.

"Jarle" wrote:

To input text i textbox I use:
.Shapes("txtbox").TextFrame.Characters.Text = Txtstring

1) If txtstring is a date or number. Can I input as date or number format?
(Replace characters.text)

2) If txtstring is i.e. "2". I want to load variable 2 (as number) into
variable k. (How to convert "2" (string) to 2(number)).

3) Same as 2 but with dates

Thank you!



All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com