Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |