Advertisement
Guest User

Farvelægningsmakro

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