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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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???
 
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.
 
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
 
Sorry, I don't understand what you mean. Perhaps you have the cell formatted
as Text.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top