6/29/2023 0 Comments Create a text box onlineIf InStr(1, Me.TextBox1.Text, ".") > 0 Then KeyAscii = 0ģ. Me.TextBox1.SelStart > 0 Then KeyAscii = 0 If KeyAscii > Asc("9") Or KeyAscii 0 Or _ VBA code: Allow only numbers to be input into the textbox: Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Then right click the textbox and select View Code from context menu to open the Microsoft Visual Basic for Applications window, and then replace the original code with the following VBA code into the blank module: ![]() Create a textbox by clicking Developer > Insert > Text Box (ActiveX Control), and then draw a textbox as you need, see screenshot:Ģ. The following VBA code can help you to enter numbers, period (.) and a negative sign only into a textbox, please do as this:ġ. ![]() Amazing! Using Efficient Tabs in Excel Like Chrome, Firefox and Safari! Save 50% of your time, and reduce thousands of mouse clicks for you every day!
0 Comments
Leave a Reply. |