Custom VBA forms. Text box as a numeric value for a cell

I was looking for some solution for this and could not find it. In fact, I have a user of my field filling out a document in the form of a user, who then puts my code in the appropriate cells. One of these input fields is a number, but no matter how I instruct excel to format the cell, the text is still in the end, and I cannot perform any calculations. I am sure this is probably a fairly simple fix, but so far I have not been able to find a solution. As always, any help is appreciated!

thank!

+4
source share
2 answers

, .

, txtNumber, Output!A1, :

Sheets("Output").Range("A1") = CDbl(txtNumber)

, , , , - CLng ( Long), CInt ( Integer), CDec ( , ).

, . " " "", .

+9

, , . , .

, "", . , , .

, .

, , "", , , . *

0

Source: https://habr.com/ru/post/1534857/


All Articles