473,386 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

input within a textbox in VBA

Hello,
I'm busy with VBA in excel.
Does anybody know how to control the input within a textbox? For example, a
textbox must contain only numbers and no text. The program must give a
warning if you type text in the textbox.

Greetings,
Hans
Jul 17 '05 #1
1 9660
In VBA, you need to create an 'on change' event for that control. Each time
the user modifies the contents of the textbox, you can use
isnumeric(yourcontrolname.text) = True to determine if the input is valid.
If the input is not numeric, you can issue a warning message to a label or
message box. Then I would use yourcontrolname.setfocus to highlight the
contents of that text box.

Hope this helps.

"avocursist59lok1" <av**************@avo-bedrijf.nl> wrote in message
news:3f***********************@news.xs4all.nl...
Hello,
I'm busy with VBA in excel.
Does anybody know how to control the input within a textbox? For example, a textbox must contain only numbers and no text. The program must give a
warning if you type text in the textbox.

Greetings,
Hans

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Vaughn | last post by:
In my MDI, I have a child form (frm_emp) that on a button click, displays another child form w/ a listview (frm_list). I had two questions: 1) Assuming I already have the emplcode the user...
0
by: Christian | last post by:
Hi all, on a PocketPC 2003 dialog I want the user to enter an IP-Adress using a TextBox control. Within the TextBox control I would like to display an predefined input mask like xxx.xxx.xxx.xxx ...
2
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory...
3
by: Neil Zanella | last post by:
Hello, I have a bunch of HTML input controls which I need to generate from within a for loop. I would like them to have id attributes set to values foo1, foo2, foo3, foo4, etc... ...
2
by: Ben | last post by:
The following error is encountered when attempt to input the character > into a textbox control : A potentially dangerous Request.Form value was detected from the client Is there a way to...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
2
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi Experts, How can I programmatically move an input cursor (a vertical bar inside those input fields, like a textbox, combobox) ? Thanks.
2
by: =?Utf-8?B?ZGxpbmdn?= | last post by:
I have a simple c# windows form with a textbox and button that, when clicked, displays a simple MessageBox. With the cursor in the textbox, I can select the Japanese language and desired Input...
2
by: darren.murray2 | last post by:
Hello all, I'm fairly new at this so I may be doing this the wrong way but I've got a FormView within a multiview that when it is updated in edit mode, will call on the update method associated...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.