Making a textbox on a form to a number.

Johncon17

New Member
Joined
Nov 26, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I have a textbox on a form that is always a number, but when this is transferred to a cell it is not read as a number, therefore I cannot do any calculations with it?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi,
maybe option general in ribbon is text , not number try to make sure that.
 
Upvote 0
Thanks but that does not work, as when it is transposed from a teaxt box it also changes the cell.
 
Upvote 0
Can you issue some pictures what try to do ?
it's difficult to guessing ,maybe I misunderstand you what you want!:rolleyes:
 
Upvote 0
In my form I have a textbox, this will only be used for numbers.
But when this is transposed to a cell it formats as text, and I do not want to keep going into the cell to change to a number (this would take ages).
Attached is the Form Textbox, and an image of that number in the cell.
 

Attachments

  • Cell.JPG
    Cell.JPG
    2.3 KB · Views: 1
  • textBox.JPG
    textBox.JPG
    11.1 KB · Views: 1
Upvote 0
CInt converts to Integer.
VBA Code:
Option Explicit
Sub ConvertStringToInteger()
Dim str as String, int as Integer
str = "25"
int = CInt(str)
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,939
Messages
6,175,529
Members
452,651
Latest member
wordsearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top