Request for excel, visual basic code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PFC jonathan smith
    New Member
    • Mar 2008
    • 1

    Request for excel, visual basic code

    I'm creating this form for the military and need some help. I need to have different circles change colors depending on input. 12 questions asking for answers b/w 0 - 100. Oval will be red for < 70, amber for 70 - 85, green for > 85
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by PFC jonathan smith
    I'm creating this form for the military and need some help. I need to have different circles change colors depending on input. 12 questions asking for answers b/w 0 - 100. Oval will be red for < 70, amber for 70 - 85, green for > 85
    Since its VBA, you cannot have chapes that easily. I recomend you to use labels with capital O's, use big bold fonts and change the fore color acording to the answers.

    Assuming the answer is entered in a text box called txtInput, and this label is called lblCircle, your code should look like this:

    [CODE=vb]if txtInput.text < 70 then
    lblCircle.forec olor = rgb(255,0,0)
    elseif txtinput.text < 85 then
    lblCircle.forec olor = rgb(255,200,0)
    else
    lblCircle.forec olor = rgb(0,175,0)
    end if[/CODE]

    HTH

    Comment

    Working...