Advertisement
Guest User

Farvelægningsmakro

a guest
Jan 22nd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Sub Farv5()
  2. Dim varSelected As Variant
  3. For Each varSelected In Selection
  4. With varSelected
  5. Select Case WorksheetFunction.Round(.Value, 1)
  6. Case Is > 5
  7. i = i + 1
  8. Case Is >= 4.5
  9. .Interior.Color = RGB(0, 176, 80)
  10. Case Is >= 4
  11. .Interior.Color = RGB(146, 208, 80)
  12. Case Is >= 3.5
  13. .Interior.Color = RGB(255, 255, 0)
  14. Case Is >= 3
  15. .Interior.Color = RGB(255, 192, 0)
  16. Case Is >= 1
  17. .Interior.Color = RGB(255, 0, 0)
  18. Case Else
  19. .Interior.Color = RGB(191, 191, 191)
  20. End Select
  21. End With
  22. Next
  23. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement