WolfLarsen85
New Member
- Joined
- Apr 25, 2016
- Messages
- 17
Hello,
I am trying to create a form in excel and I am dropping values from the form into an excel cell. The problem I am having is that I can't get the values that drop into excel to format as numbers. Here is the code I have thus far. I set "txtBody" as an integer, but when I fill out the txtBody text box it still formats as general. Please help and let me know if anything else is needed.
Private Sub cmdEnter_Click()
Dim ws As Worksheet
Set ws = Worksheets("Dungeonslayers")
' Check user input
' Enter Data into Cell
Dim txtBody As Integer
ws.Cells(7, 3).Value = txtPlayer
ws.Cells(9, 3).Value = CmboRace
ws.Cells(11, 3).Value = txtAbilities
ws.Cells(8, 4).Value = cboLevel
ws.Cells(7, 7).Value = txtCharacter
ws.Cells(11, 7).Value = cboClass
ws.Cells(8, 5).Value = txtPP
ws.Cells(8, 6).Value = txtTP
ws.Cells(11, 5).Value = txtExperience
ws.Cells(11, 11).Value = cboHero
ws.Cells(13, 7).Value = txtMind
ws.Cells(15, 7).Value = txtIntellect
ws.Cells(17, 7).Value = txtAura
ws.Cells(13, 3).Value = txtBody
ws.Cells(15, 3).Value = txtStrength
ws.Cells(17, 3).Value = txtConstitution
ws.Cells(10, 9).Value = txtExperience
ws.Cells(13, 5).Value = txtMobility
ws.Cells(15, 5).Value = txtAgility
ws.Cells(17, 5).Value = txtDexterity
End Sub
Private Sub cmdExit_Click()
End
End Sub
I am trying to create a form in excel and I am dropping values from the form into an excel cell. The problem I am having is that I can't get the values that drop into excel to format as numbers. Here is the code I have thus far. I set "txtBody" as an integer, but when I fill out the txtBody text box it still formats as general. Please help and let me know if anything else is needed.
Private Sub cmdEnter_Click()
Dim ws As Worksheet
Set ws = Worksheets("Dungeonslayers")
' Check user input
' Enter Data into Cell
Dim txtBody As Integer
ws.Cells(7, 3).Value = txtPlayer
ws.Cells(9, 3).Value = CmboRace
ws.Cells(11, 3).Value = txtAbilities
ws.Cells(8, 4).Value = cboLevel
ws.Cells(7, 7).Value = txtCharacter
ws.Cells(11, 7).Value = cboClass
ws.Cells(8, 5).Value = txtPP
ws.Cells(8, 6).Value = txtTP
ws.Cells(11, 5).Value = txtExperience
ws.Cells(11, 11).Value = cboHero
ws.Cells(13, 7).Value = txtMind
ws.Cells(15, 7).Value = txtIntellect
ws.Cells(17, 7).Value = txtAura
ws.Cells(13, 3).Value = txtBody
ws.Cells(15, 3).Value = txtStrength
ws.Cells(17, 3).Value = txtConstitution
ws.Cells(10, 9).Value = txtExperience
ws.Cells(13, 5).Value = txtMobility
ws.Cells(15, 5).Value = txtAgility
ws.Cells(17, 5).Value = txtDexterity
End Sub
Private Sub cmdExit_Click()
End
End Sub