RP1America
Technical User
Greetings!
2 part question:
1) Within a Userform, how do I make data entered into a text show as currency ($)? I currently have the textboxes set to allow only numeric and only one decimal point, yet I cannot figure out how to make it show as currency. I would also like to permit only two decimal places, which I have not figured out. Here is what I have thus far ("gross" is a textbox):
Private Sub gross_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Asc("0") To Asc("9")
Case Asc(".")
If InStr(1, Me.gross.Text, ".") > 0 Then
KeyAscii = 0
End If
Case Else
KeyAscii = 0
End Select
End Sub
2) I have 4 textboxes in which dollar amounts will be entered by the user; gross, federal withholding, state withholding, and medical withhodling. I have another textbox that I would like to display the difference from gross in real time - as in gross minus everything else. Can this be done?
Thanks for your time and help!!
Ryan
2 part question:
1) Within a Userform, how do I make data entered into a text show as currency ($)? I currently have the textboxes set to allow only numeric and only one decimal point, yet I cannot figure out how to make it show as currency. I would also like to permit only two decimal places, which I have not figured out. Here is what I have thus far ("gross" is a textbox):
Private Sub gross_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Asc("0") To Asc("9")
Case Asc(".")
If InStr(1, Me.gross.Text, ".") > 0 Then
KeyAscii = 0
End If
Case Else
KeyAscii = 0
End Select
End Sub
2) I have 4 textboxes in which dollar amounts will be entered by the user; gross, federal withholding, state withholding, and medical withhodling. I have another textbox that I would like to display the difference from gross in real time - as in gross minus everything else. Can this be done?
Thanks for your time and help!!
Ryan