PDA

View Full Version : Solved: Menu?



austenr
08-19-2010, 09:47 AM
I have a bunch of these:

If Sheets("Input + Wksheet").Range("G6").Value >= 65 And Sheets("Input + Wksheet").Range("G7").Value >= 65 _
And Sheets("Input + Wksheet").CheckBoxes("Check Box 85").Value = xlOn Then

With Sheets("Direct Bill Only")
.Range("I12").Value = "X"
.Range("E25").Formula = "=vlookup(YearsofService, Indemnity, 14, False)/12"
.Range("F25").Formula = "=(Indemnity!o42/12)-e25"
.Range("J25").Formula = "=(VLOOKUP(YearsOfService,Indemnity,14,FALSE) + VLOOKUP(YearsOfService,Indemnity,15,FALSE))/12"
.Range("K25").Formula = "=(indemnity!O42 + indemnity!P42)/12 - J25"
End With

With Sheets("Direct Bill with RIA")
.Range("I11").Value = "X"
.Range("E20").Formula = "=vlookup(YearsofService, Indemnity, 14, False)/12"
.Range("F20").Formula = "=(Indemnity!o42/12)-e20"
.Range("J20").Formula = "=(VLOOKUP(YearsOfService,Indemnity,14,FALSE) + VLOOKUP(YearsOfService,Indemnity,15,FALSE))/12"
.Range("K20").Formula = "=(indemnity!O42 + indemnity!P42)/12 - J20"

End With
End If

in a sub. Is there a way to somehow put them in a menu and select them?

Bob Phillips
08-19-2010, 10:00 AM
Put what in a menu exactly Austen?

austenr
08-19-2010, 10:06 AM
Bob, I got a bunch of If statements as above. Each with different criteria. But I have a problem. The above code the way my sub is structured now will never get hit because there is an If statement above it in the sub that has two of the three same conditions in it minus the check box. If the sub is called from the button, and it falls through the code, it currently hits the If with the two conditions being true and executes it first.

Trying to figure a way around so that the correct If statement is executed based on the criteria in the IF statement. If you have a better Idea (which I am sure you do) I would be glad to hear it.

Bob Phillips
08-19-2010, 10:16 AM
Austen, isn't the problem then just the order that you have your If statements. If one is important than another, then put that earlier in the sequence.

austenr
08-19-2010, 10:17 AM
I thought about that and have it there now, just wasnt sure if there was a more efficient way.

Bob Phillips
08-19-2010, 10:28 AM
The problem with the menu is someone has to pick from it, and you can't control what they pick :)

Select Case might be more structured, but it amounts to the same thing.

austenr
08-19-2010, 10:32 AM
more thinking out loud i guess.