View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Select Case organization help

Alicia,
I'm with Otto on this, but may be you something like this ...
- Assuming they can select from none to all of the options, you can use the
bits of a long to store those selected, provided there are less than 32
options

dim OptionsChosen as long

If opt1.value=true then OptionsChosen =OptionsChosen or 1
If opt2.value=true then OptionsChosen =OptionsChosen or 2
If opt3.value=true then OptionsChosen =OptionsChosen or 4

and you check if, say opt3 was selected with :
If OptionsChosen and 4=4 then ... whatever

- Or you could use an array
Dim Options(1 to 3) as boolean

options(1)=opt1.value
options(2)=opt2.value
etc...

NickHK

"Alicia" wrote in message
...
Oh helpful ones,

I need help organizing the Select Case I'm trying to build. It's
overwhelming me!

I am trying to have rates for Medical and Dental insurance self-populate
when you choose the options. So, A2 would be Medical rate for employee on
row 2 and B2 would be the Dental rate for EE on row 2.

Here are the various options:
MEDICAL:
Employee can choose:
Option 1, Option 2 or Option 3.

EE, EE/SP, EE/CH or Family (EE/SP/CH)

Employee is:

Salary, Commission/PT or GLR (different rates)

We "X" the box for what the employee has chosen (Options and coverage)

which
seems to me is a string. So that makes strOpt and strDep. How do I

declare
properly so that if there's an X in the Option 1 box that strOpt is = 1,
Option 2 makes strOpt = 2, etc.

Same thing with strDep (1, 2, 3 or 4). Is String the right choice?

If the EE is GLR, Salary, Commission and PT don't matter. However, if

they
aren't GLR, then Salary and Commission or PT have different rates

I have a separate sheet with named ranges (Opt1, Opt2, Opt 3 and Den) and
each one has the Dep status on the right column with the Sal, Comm/PT or

GLR
heading across.

I think I could build this with a whole bunch of If..then.. statements but
Select Case seems to be the way to go. I'm just having a hard time

wrapping
my head around it.

The last question is where do I put it so the rates pop up at the right
time. Is this an OnExit procedure from a cell?

I usually use VLookup but I think this is too complicated for a formula.
Any and all suggestions are welcome! If you can come up with a formula,
please do!

Let me know if you need more info.

Thanks,
Alicia