LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Some fields required question

Hello All,

I use the following code which loops through all fields on my user form,
searching for any text box that does not contain data.

Question: How can i modify this code such that only some of the fields are
searched for missing data, rather than all. Reason: on my user form, 40 of
the 60 text boxes are required entry, and i want to make sure those fields
contain data.

Dim ctrl as Object
for each ctrl in Userform1.Controls
if typeof ctrl is msforms.combobox then
if ctrl.Value = "" then
msgbox "Missing Data in " & ctrl.Name
exit sub
end if
end if
Next

--
Carlee
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to have fields to be required Mandatory fields in Excel Excel Worksheet Functions 1 June 6th 08 10:41 PM
Required Sheet and fields ralphdevlin via OfficeKB.com Excel Programming 2 April 17th 06 09:00 PM
Required fields Brian Boguhn Excel Programming 5 January 10th 06 05:51 PM
Required fields Emily Excel Discussion (Misc queries) 1 June 23rd 05 12:59 AM
Required fields Lupe[_2_] Excel Programming 1 June 2nd 04 02:50 PM


All times are GMT +1. The time now is 08:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"