antman2988
Board Regular
- Joined
- Jun 28, 2018
- Messages
- 78
Hello,
I have a checkbox that changes the color of a cell if it is checked. The user can't print the page until a value is entered into the highlighted field. Both the checkbox and restrict printing modules are working properly.
How do I change the color of the highlighted field once the user enters a value? I wrote the below code, but it isn't working. I am newer to VBA so any help is appreciated!
Edit: The code works fine when I manually run it. How do I make sure it runs once a user enters a value?
I have a checkbox that changes the color of a cell if it is checked. The user can't print the page until a value is entered into the highlighted field. Both the checkbox and restrict printing modules are working properly.
How do I change the color of the highlighted field once the user enters a value? I wrote the below code, but it isn't working. I am newer to VBA so any help is appreciated!
Edit: The code works fine when I manually run it. How do I make sure it runs once a user enters a value?
Code:
[COLOR=#333333]Private Sub Can_Print()[/COLOR]
[COLOR=#333333] If IsEmpty(Range("G54")) = False Then[/COLOR]
[COLOR=#333333] MsgBox "You may now print."[/COLOR]
[COLOR=#333333] Range("G54").Interior.Color = RGB(221, 235, 247)
End If[/COLOR]
[COLOR=#333333]End Sub[/COLOR]
Last edited: