Consulting

Results 1 to 7 of 7

Thread: Solved: Menu?

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Solved: Menu?

    I have a bunch of these:

    [VBA]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[/VBA]

    in a sub. Is there a way to somehow put them in a menu and select them?
    Peace of mind is found in some of the strangest places.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Put what in a menu exactly Austen?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    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.
    Peace of mind is found in some of the strangest places.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    I thought about that and have it there now, just wasnt sure if there was a more efficient way.
    Peace of mind is found in some of the strangest places.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    more thinking out loud i guess.
    Peace of mind is found in some of the strangest places.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •