ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Return a formula (https://www.excelbanter.com/excel-programming/369462-return-formula.html)

Patrick Simonds

Return a formula
 
Is there any way to force this to be a formula when it is placed in cell B3?
I want someone to be able to enter say 10 + 10 and have the result be 20 in
cell B3. I know you can enter =10+10 and it will return 20, but I can not
count on everyone remembering (knowing to use) the = sign.

Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Worksheets("Income").Range("B3").Value = TextBox80.Value

End Sub



Gary Keramidas

Return a formula
 
i changed it up because i don't have your code, but this worked for me when i
clicked a commandbutton on the form after entering 10+10 into textbox1

Private Sub CommandButton1_Click()
Worksheets("Sheet2").Range("B3").Formula = "=" & UserForm1.TextBox1.Value
End Sub

--


Gary


"Patrick Simonds" wrote in message
...
Is there any way to force this to be a formula when it is placed in cell B3? I
want someone to be able to enter say 10 + 10 and have the result be 20 in cell
B3. I know you can enter =10+10 and it will return 20, but I can not count on
everyone remembering (knowing to use) the = sign.

Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Worksheets("Income").Range("B3").Value = TextBox80.Value

End Sub




Patrick Simonds

Return a formula
 
Thanks.

This is how the finished code looked:

Worksheets("Income").Range("B3").Formula = "=" & TextBox80.Value


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i changed it up because i don't have your code, but this worked for me when
i clicked a commandbutton on the form after entering 10+10 into textbox1

Private Sub CommandButton1_Click()
Worksheets("Sheet2").Range("B3").Formula = "=" & UserForm1.TextBox1.Value
End Sub

--


Gary


"Patrick Simonds" wrote in message
...
Is there any way to force this to be a formula when it is placed in cell
B3? I want someone to be able to enter say 10 + 10 and have the result be
20 in cell B3. I know you can enter =10+10 and it will return 20, but I
can not count on everyone remembering (knowing to use) the = sign.

Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Worksheets("Income").Range("B3").Value = TextBox80.Value

End Sub






Gary Keramidas

Return a formula
 
glad you got it working.

--


Gary


"Patrick Simonds" wrote in message
...
Thanks.

This is how the finished code looked:

Worksheets("Income").Range("B3").Formula = "=" & TextBox80.Value


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i changed it up because i don't have your code, but this worked for me when i
clicked a commandbutton on the form after entering 10+10 into textbox1

Private Sub CommandButton1_Click()
Worksheets("Sheet2").Range("B3").Formula = "=" & UserForm1.TextBox1.Value
End Sub

--


Gary


"Patrick Simonds" wrote in message
...
Is there any way to force this to be a formula when it is placed in cell B3?
I want someone to be able to enter say 10 + 10 and have the result be 20 in
cell B3. I know you can enter =10+10 and it will return 20, but I can not
count on everyone remembering (knowing to use) the = sign.

Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Worksheets("Income").Range("B3").Value = TextBox80.Value

End Sub









All times are GMT +1. The time now is 02:11 AM.

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