changing a text value to a number value in a textbox?

R

reb

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???
 
V

Vasant Nanavati

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.
 
R

reb

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
 
V

Vasant Nanavati

Sorry, I don't understand what you mean. Perhaps you have the cell formatted
as Text.
 
R

reb

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
 
Top