Skip to content

Instantly share code, notes, and snippets.

@beny
Created June 7, 2013 14:22
Show Gist options
  • Save beny/5729615 to your computer and use it in GitHub Desktop.
Save beny/5729615 to your computer and use it in GitHub Desktop.
Color selected cell background with color defined inside as hex code (#aabbff)
Sub Color()
For Each rCell In Selection
rCell.Interior.Color = RGB(CInt("&H" & Mid(rCell.Value, 2, 2)), CInt("&H" & Mid(rCell.Value, 4, 2)), CInt("&H" & Mid(rCell.Value, 6, 2)))
Next rCell
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment