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

Greetings !

Tom suggests I need a userform.

My code at the moment includes :

---------------------------
Do
CutOffDate = InputBox("Enter the cut-off date " & _
"and time you want," & vbCrLf & _
"i.e. copy only files more recent" & _
vbCrLf & _
"in the format dd/mm/yyyy hh:mm:ss", _
"Get Cut-off Date & Time", _
"04/08/2004 07:30:00")
If Len(CutOffDate) < 19 _
Or Mid(CutOffDate, 3, 1) < "/" _
Or Mid(CutOffDate, 6, 1) < "/" _
Or Mid(CutOffDate, 11, 1) < " " _
Or Mid(CutOffDate, 14, 1) < ":" _
Or Mid(CutOffDate, 17, 1) < ":" Then
'We don't have a valid entry
OK = False
Else
OK = True
End If
Loop While Not OK
---------------------------

I was going to use :

---------------------------
Dim IWantNewer as Boolean

IWantNewer = InputBox("Enter Y if you want " & _
"newer files, " & vbCrLf & _
"or N if not", _
"Newer files ?", _
"N")
---------------------------

but Tom suggests a userform. How do I code that ?

IWantNewer = UserForm(....???)


Help !


RClay AT haswell DOT com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform

You said you had 4 inputboxes that received boolean values. I **asked**

You want to replace your four input boxes with a userform with 4

optionbuttons?


Your first example of getting a date has nothing to do with boolean values.
If you are only going to get one response, then you should probably use a
msgbox. Then the user only has to click, not type in a value.

Dim IWantNewer as Boolean
IWantNewer = InputBox("Do you want " & _
"newer files, " , vbYesNo) = vbYes

--
Regards,
Tom Ogilvy







"Robin Clay" wrote in message
...
Greetings !

Tom suggests I need a userform.

My code at the moment includes :

---------------------------
Do
CutOffDate = InputBox("Enter the cut-off date " & _
"and time you want," & vbCrLf & _
"i.e. copy only files more recent" & _
vbCrLf & _
"in the format dd/mm/yyyy hh:mm:ss", _
"Get Cut-off Date & Time", _
"04/08/2004 07:30:00")
If Len(CutOffDate) < 19 _
Or Mid(CutOffDate, 3, 1) < "/" _
Or Mid(CutOffDate, 6, 1) < "/" _
Or Mid(CutOffDate, 11, 1) < " " _
Or Mid(CutOffDate, 14, 1) < ":" _
Or Mid(CutOffDate, 17, 1) < ":" Then
'We don't have a valid entry
OK = False
Else
OK = True
End If
Loop While Not OK
---------------------------

I was going to use :

---------------------------
Dim IWantNewer as Boolean

IWantNewer = InputBox("Enter Y if you want " & _
"newer files, " & vbCrLf & _
"or N if not", _
"Newer files ?", _
"N")
---------------------------

but Tom suggests a userform. How do I code that ?

IWantNewer = UserForm(....???)


Help !


RClay AT haswell DOT com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform

Whoops,
didn't finish altering your code:

Dim IWantNewer as Boolean
IWantNewer = MsgBox("Do you want " & _
"newer files, " , vbYesNo) = vbYes

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
You said you had 4 inputboxes that received boolean values. I **asked**

You want to replace your four input boxes with a userform with 4

optionbuttons?


Your first example of getting a date has nothing to do with boolean

values.
If you are only going to get one response, then you should probably use a
msgbox. Then the user only has to click, not type in a value.

Dim IWantNewer as Boolean
IWantNewer = InputBox("Do you want " & _
"newer files, " , vbYesNo) = vbYes

--
Regards,
Tom Ogilvy







"Robin Clay" wrote in message
...
Greetings !

Tom suggests I need a userform.

My code at the moment includes :

---------------------------
Do
CutOffDate = InputBox("Enter the cut-off date " & _
"and time you want," & vbCrLf & _
"i.e. copy only files more recent" & _
vbCrLf & _
"in the format dd/mm/yyyy hh:mm:ss", _
"Get Cut-off Date & Time", _
"04/08/2004 07:30:00")
If Len(CutOffDate) < 19 _
Or Mid(CutOffDate, 3, 1) < "/" _
Or Mid(CutOffDate, 6, 1) < "/" _
Or Mid(CutOffDate, 11, 1) < " " _
Or Mid(CutOffDate, 14, 1) < ":" _
Or Mid(CutOffDate, 17, 1) < ":" Then
'We don't have a valid entry
OK = False
Else
OK = True
End If
Loop While Not OK
---------------------------

I was going to use :

---------------------------
Dim IWantNewer as Boolean

IWantNewer = InputBox("Enter Y if you want " & _
"newer files, " & vbCrLf & _
"or N if not", _
"Newer files ?", _
"N")
---------------------------

but Tom suggests a userform. How do I code that ?

IWantNewer = UserForm(....???)


Help !


RClay AT haswell DOT com





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Userform


-----Original Reply from Tom Ogilvy-----
You said you had 4 inputboxes that received
boolean values. I **asked**
You want to replace your four input boxes with a
userform with 4 optionbuttons?


"Userforms" are "terra incognita" to me, alas....
and I would prefer to avoid yet another learning curve....

Your first example of getting a date has nothing
to do with boolean values.


Erm... yes, sorry - I guess that was a bit of a red
herring - but indicated my current "thought process"

If you are only going to get one response,
then you should probably use a msgbox.
Then the user only has to click, not type in a value.


Ah. Thank you.

Dim IWantNewer as Boolean
IWantNewer = InputBox("Do you want " & _
"newer files, " , vbYesNo) = vbYes


Looks just the job.

I have four such Boolean questions, and thought that four
buttons on screen at once might be easier for the user
than four consecutive MsgBoxes.

But I guess you're right.

Yet again ! <grin


Thank you very much. Again !


RClay AT haswell DOT com

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
userform Aashi Excel Programming 2 April 25th 04 06:39 PM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM
Userform Edgar Thoemmes Excel Programming 5 February 16th 04 03:02 PM
userform billQ Excel Programming 3 November 19th 03 03:41 AM
userform jim apostolidis Excel Programming 1 August 11th 03 10:37 AM


All times are GMT +1. The time now is 10:37 PM.

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

About Us

"It's about Microsoft Excel"