ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing a text value to a number value in a textbox? (https://www.excelbanter.com/excel-programming/295608-changing-text-value-number-value-textbox.html)

reb

changing a text value to a number value in a textbox?
 
i can send a text value ,but not a number value to my worksheet, here the code
Private Sub TextBox1_change(
Set c = Worksheets("Sheet1").Range("a2"
c.Value = TextBox
help???

Vasant Nanavati

changing a text value to a number value in a textbox?
 
Your code works for me. Try with the first line:

Dim c As Range

It may help. In any event, it's very bad programming practice not to declare
your variables explicitly.

--

Vasant

"reb" wrote in message
...
i can send a text value ,but not a number value to my worksheet, here the

code:
Private Sub TextBox1_change()
Set c = Worksheets("Sheet1").Range("a2")
c.Value = TextBox1
help???




reb

changing a text value to a number value in a textbox?
 
tried it ,but it still shows a text,problem is ,it won't add,,shows as a text inpu
Private Sub TextBox1_change(
Dim c As Rang
Set c = Worksheets("Sheet1").Range("a2"
c.Value = TextBox1

Vasant Nanavati

changing a text value to a number value in a textbox?
 
Sorry, I don't understand what you mean. Perhaps you have the cell formatted
as Text.

--

Vasant

"reb" wrote in message
...
tried it ,but it still shows a text,problem is ,it won't add,,shows as a

text input
Private Sub TextBox1_change()
Dim c As Range
Set c = Worksheets("Sheet1").Range("a2")
c.Value = TextBox1




reb

changing a text value to a number value in a textbox?
 
tried formating cell in excel worksheet as a number ,still ,no help ,i can use an "if "command in vba to change 1 to 0
if checkbox1.value the
sheet1.range("a2")=
els
sheet1.range(A2")=
end i
but ,i could only get it to work with a checkbox ,and an optionsbutton ,so i'm wondering ,if it is the way a textbox is set up ,and if so ,then i'll need to find a work aroun
p.
sorry about my programming ,just started reading about it a week ago


All times are GMT +1. The time now is 06:14 PM.

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