How To Allow ONLY Numbers and Decimals to a Textbox - [Free Download] - Excel VBA Training

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 25

  • @EricHartwigExcelConsulting
    @EricHartwigExcelConsulting 2 роки тому +1

    Great Stuff Dan! Thank you for creating/sharing this video!

  • @krn14242
    @krn14242 2 роки тому +1

    Thanks Dan. Nice to see you talking about "old" vba again. LOL.

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  2 роки тому

      Haha. True. I love new things but there's so much that can be done with core elements! Thanks Kevin!

  • @Info-God
    @Info-God 2 роки тому

    A straightforward solution. Thank you very much!

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  2 роки тому

      Thank you! And sorry for the delay, but I'm glad you liked it :)

    • @Info-God
      @Info-God 2 роки тому +1

      @@ExcelVbaIsFun No problem. Actually I might have few things to add to your solution for - Numeric only data entry in a text box. But only if you'd like or think to have a part 2, 3 to your solution.

  • @kenc8411
    @kenc8411 Рік тому +1

    I usually try to avoid the vbKey constants wherever I can, unless it's something that doesn't produce a character on screen like BackSpace, Home, Ctrl, etc. I'd use ASC() to trap my visual keys, like in the numeric case, I always use ASC("0") TO ASC("9"), which will trap my numeric inputs whether it's from the NumPad or the top row. Never fails. For decimals or any kind of symbol I will also use ASC("."), ASC("-"), and so on.

  • @wayneedmondson1065
    @wayneedmondson1065 2 роки тому +1

    Cool! Thanks Dan. Thumbs up!!

  • @cbay11
    @cbay11 2 роки тому

    Hi dan love the work, is there a way you could do a tutorial on how to do a userform macro for selecting documents using option buttons for different worksheets, that firstly needs to be selected, then using a command button to confirm the document selection to open the desired worksheet from the numerous options? Thank you if so!

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  2 роки тому

      Hi cbay11,
      Can you show me a demo workbook or send me a loom video to better describe this process? That may help me visualize what you're needing better. You can reach me at dan@excelvbaisfun.com
      Thanks
      Dan

  • @SmartExpertDesigns
    @SmartExpertDesigns Рік тому

    How to allow fractions and when Enter key pressed then it fills a value on a specific cell

  • @thomasfergusen5144
    @thomasfergusen5144 2 роки тому +1

    Great! Thank you very much

  • @ruileite6531
    @ruileite6531 2 роки тому

    Many thanks (Y) Great work!

  • @CryptoWavePatterns
    @CryptoWavePatterns 2 роки тому

    Please help! How to format a textbox in a Sheet (not in a userform) to have 2 decimal places. Thank you, sir!

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  2 роки тому

      Is this an ActiveX textbox on a Sheet or Form Controls?
      If ActiveX, here's a quick and dirty example I just threw together that is working for me. When you leave the control using the LostFocus event, it updates the value by rounding it to 2 decimal places.
      If you need to know more about using Worksheet events, please check out our Excel course on excelvbaisfun.com for a more thorough explanation. We may also have some lessons on the channel on an event here or there.
      Here's the code I made for you:
      Private Sub TextBox1_LostFocus()
      On Error Resume Next
      Me.TextBox1 = Round(Me.TextBox1, 2)
      End Sub
      (assumes your textbox is Activex and called 'Textbox1'
      Thanks
      Dan

  •  2 роки тому

    Hai dan sir ! I have a problem.
    I want a message when i click my excel file's any cell so what code i run please tell me. Reply plz🙏🏻

    • @ExcelVbaIsFun
      @ExcelVbaIsFun  2 роки тому

      Hi Garvit,
      You can have a message popup when you click on any cell in a workbook, when you click on a specific cell, when you double click something, right click something, or when you change a cell's value. It just depends on what you want it to do. We have tons of lectures on the topic in our course here: www.excelvbaisfun.com/ultimate-excel-pro/

    •  2 роки тому

      @@ExcelVbaIsFun but sir until i start course, you tell me the code for msg box in excel any cell click..please

  • @CarlFritz24
    @CarlFritz24 Рік тому

    FORMAT a Textbox to show NUMBER (in order to be saved as DECIMAL NUMBER) is the REAL NEED of everyone. There are some so TEDIOUS videos on the matter, that we only can get out of them (so showing off they are). Can you just and simply do THAT ? There is a situation here, in your video: what if... instead of a keystroke, the mouse is used (on clicking the button SAVE, for instance).

  • @MJLCabral
    @MJLCabral Рік тому

    The download link is broken... :(