@@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.
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.
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!
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
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🙏🏻
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
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).
Great Stuff Dan! Thank you for creating/sharing this video!
Thanks! So glad you enjoyed it!
Thanks Dan. Nice to see you talking about "old" vba again. LOL.
Haha. True. I love new things but there's so much that can be done with core elements! Thanks Kevin!
A straightforward solution. Thank you very much!
Thank you! And sorry for the delay, but I'm glad you liked it :)
@@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.
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.
That's fantastic!!
Cool! Thanks Dan. Thumbs up!!
Thanks, Wayne! :)
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!
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
How to allow fractions and when Enter key pressed then it fills a value on a specific cell
Great! Thank you very much
Very welcome, thomas!!
Many thanks (Y) Great work!
Thanks so much!
Please help! How to format a textbox in a Sheet (not in a userform) to have 2 decimal places. Thank you, sir!
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
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🙏🏻
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/
@@ExcelVbaIsFun but sir until i start course, you tell me the code for msg box in excel any cell click..please
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).
The download link is broken... :(