Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Validation against two criteria

Bascially I have a routine that allows a user to select certain days of the
week using a MultiSelect listbox and a range of time in two inputboxes
(BeginDate and EndDate). Based on that criteria, the macro selects random
dates from the date range. I need to do two things:

1. Ensure that the random day selected is a day selected by the user in the
listbox
2. If the day is valid, I need to ensure that the date has not already been
selected

If either 1 or 2 are not valid, another random date must be chosen and then
tested against 1 and 2 again.

I have another project in which random numbers are selected and I call a
separate function to check for duplicate values. I tried using that and
another function to test for the valid day, but I'm getting lost when a new
date is selected and having to test for both criteria again.

Any help is appreciated.

TIA
Mike

--
Michael J. Malinsky



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Validation against two criteria - clarification

A little clarification...

As stated in my previous post, I have a function that can check for a
duplicate number that I'm trying to use in this project. So what I am
currently trying to do is create a second function that will check for a
valid day. So my main sub first calls the day validation function then the
duplicate number function, passing the appropriate variables. So if I have
a bad day, the the function will select another day until a valid one is
selected, then if a duplicate date is chosen, another will be selected until
a non-duplicate is selected. But then if this non-duplicate is not a valid
day, the valid_day function is no run again to catch this problem.

I feel that I should somehow capture the selected items from the listbox in
an array rather than using an if selected loop to check for the valid day,
but I'm not sure if that will solve the problem. I also get the feeling
that I could use a while...wend statement in the main sub that checks for a
flag value that would be set if both criteria mentioned in my previous post
are met.

Any suggestions?

Again, TIA.
Mike


--
Michael J. Malinsky


"Michael J. Malinsky" wrote in message
...
Bascially I have a routine that allows a user to select certain days of

the
week using a MultiSelect listbox and a range of time in two inputboxes
(BeginDate and EndDate). Based on that criteria, the macro selects random
dates from the date range. I need to do two things:

1. Ensure that the random day selected is a day selected by the user in

the
listbox
2. If the day is valid, I need to ensure that the date has not already

been
selected

If either 1 or 2 are not valid, another random date must be chosen and

then
tested against 1 and 2 again.

I have another project in which random numbers are selected and I call a
separate function to check for duplicate values. I tried using that and
another function to test for the valid day, but I'm getting lost when a

new
date is selected and having to test for both criteria again.

Any help is appreciated.

TIA
Mike

--
Michael J. Malinsky





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
Data Validation with 2 criteria Dana M Excel Worksheet Functions 6 February 7th 09 11:13 PM
Setting the Validation Criteria on the fly PDABACC Excel Discussion (Misc queries) 1 November 10th 07 02:53 PM
multiple data validation criteria Greyling Excel Discussion (Misc queries) 3 May 15th 07 07:10 PM
Data validation two criteria Graham Haughs Excel Worksheet Functions 3 February 25th 06 04:31 PM
Validation - multiple criteria in one cell krd Excel Discussion (Misc queries) 0 August 17th 05 08:23 PM


All times are GMT +1. The time now is 12:33 AM.

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"