469,159 Members | 1,474 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,159 developers. It's quick & easy.

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
Mar 11 '08 #1
1 942
kadghar
1,295 Expert 1GB
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:

Expand|Select|Wrap|Line Numbers
  1. if txtInput.text < 70 then 
  2.     lblCircle.forecolor = rgb(255,0,0)
  3. elseif txtinput.text < 85 then
  4.     lblCircle.forecolor = rgb(255,200,0)
  5. else
  6.     lblCircle.forecolor = rgb(0,175,0)
  7. end if
HTH
Mar 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
14 posts views Thread by pmud | last post: by
3 posts views Thread by James Wong | last post: by
3 posts views Thread by Mitchell Vincent | last post: by
2 posts views Thread by Rod | last post: by
2 posts views Thread by Agnes | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.