#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userforms


Hey, I'm a beginner and I just wanted to ask if does anyone know how to
create a code that would make the users of a userform fill out certain
textfields, or show them a message saying that they have to type
information before adding the data to the spreadsheet? I've already
created the code for the userform so I will take forever to create a
code for each one of the txtFields so is there anyway I can create one
that would required that for all of them at once?

Do I make my self clear?


--
restrepoblessin
------------------------------------------------------------------------
restrepoblessin's Profile: http://www.excelforum.com/member.php...o&userid=27170
View this thread: http://www.excelforum.com/showthread...hreadid=466781

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Userforms

Place the validation in your Ok and Exit procedures. The user has to leave
the form to get cack to the spreadsheet (usually through an OK button or
something similar). In the code for this button do something like this...

sub cmdOK_Click()

if trim(textbox1.value) = "" then
msgbox "Please ensure that all required fields are completed before
proceeding"
textbox1.setfocus
elseif trim(textbox2.value) = "" then
msgbox "Please ensure that all required fields are completed before
proceeding"
textbox2.setfocus
else
me.hide
end if
end sub
--
HTH...

Jim Thomlinson


"restrepoblessin" wrote:


Hey, I'm a beginner and I just wanted to ask if does anyone know how to
create a code that would make the users of a userform fill out certain
textfields, or show them a message saying that they have to type
information before adding the data to the spreadsheet? I've already
created the code for the userform so I will take forever to create a
code for each one of the txtFields so is there anyway I can create one
that would required that for all of them at once?

Do I make my self clear?


--
restrepoblessin
------------------------------------------------------------------------
restrepoblessin's Profile: http://www.excelforum.com/member.php...o&userid=27170
View this thread: http://www.excelforum.com/showthread...hreadid=466781


Reply
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
Userforms carlito_1985[_4_] Excel Programming 2 September 12th 05 09:04 AM
userforms [email protected] Excel Programming 0 February 16th 05 06:48 PM
Esc out of userforms Mark \(InWales\)[_23_] Excel Programming 2 February 2nd 05 10:08 PM
userforms [email protected] Excel Programming 1 January 11th 05 01:07 PM
userforms Jo[_4_] Excel Programming 2 September 17th 03 10:35 PM


All times are GMT +1. The time now is 03:02 AM.

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"