📊 Free Workbooks: www.excelvbaisfun.com/links?u...
🥷Join Excel Ninja Pro: www.excelvbaisfun.com/ninjapr... Months FREE On Annual Plan Auto Applied)
🥷Excel Ninjas FB Group: www.excelvbaisfun.com/xlninjas (Free downloads, Trainings, Live Q&A and more)
Hey everybody Dan Strong here with Excel VBA Is Fun this week we had a question, "how do you take a text box and only allow it to do numbers and also a decimal place (and also the negative sign
but nothing else)?"
So we're going to dive into how to allow numbers and decimals only to Textboxes in Excel VBA. It's actually very easy. First, we'll make and set up a quick Userform to test on.
This video includes a thorough look at the KeyDown event and its parameters, so hopefully you're taking notes!
We'll also review these topics in the video: Limiting numbers using KeyCode Constants, Allowing Subtract and Decimal keys, How to disable any keystroke, Number pad keys vs regular keys, How to figure out a keycode the easy way, Determine whether Shift key is held down, Adding Enter/Return key - and lots more!
If you have any questions, please leave comments below.
🟡Download Workbook: www.excelvbaisfun.com/sdm_dow...
Fantastic Developer Tools:
🔒 Transform Any Excel File Into A Locked EXE: www.excelvbaisfun.com/secure-... (25% off with code ‘25OFF’)
🟡 Create Custom Installers: www.excelvbaisfun.com/custom-...
👋 Business Inquiries, Consulting, Comments, etc: www.excelvbaisfun.com/contact/
00:00 Intro
00:18 Make & Set-Up Userform
00:58 Looking at Textbox Events
01:08 KeyDown Event Method
02:28 Limiting numbers using KeyCode Constants
02:53 Allowing Subtract and Decimal keys
03:58 How to disable any keystroke
04:30 Number pad keys vs regular keys
06:00 How to figure out a keycode the easy way
06:55 Determine whether Shift key is held down
08:00 Adding Enter/Return key, etc
Негізгі бет How To Allow ONLY Numbers and Decimals to a Textbox - [Free Download] - Excel VBA Training
Пікірлер: 25