Masta
New Member
- Joined
- Feb 22, 2022
- Messages
- 33
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
I almost finish my little project for my job to automatize processes but i encounter 1 problem. I need help with coding in VBA, I don't know how to save the state of the CommandButton1 and the rest of the CommandButtons the buttons were pressed and then they changed color and that change is saved the next time I open that file so I can see that change I made. So far, I have coded the color change I wanted, but when a refresh of the form is done or Excel is exited, that change is reset and returns to its original state as if there was no change. I try with case statement but i have no luck so far. Thank you.
Example:
Private Sub CommandButton1_Click()
CommandButton1.BackColor = RGB(0, 200, 150) 'Green
Worksheets("Odgovori").Range("H6").Value = "e-Mail"
End Sub
Private Sub CommandButton2_Click()
CommandButton2.BackColor = RGB(255, 255, 0) 'Yellow
Worksheets("Odgovori").Range("H6").Value = "Adresa"
End Sub
Example:
Private Sub CommandButton1_Click()
CommandButton1.BackColor = RGB(0, 200, 150) 'Green
Worksheets("Odgovori").Range("H6").Value = "e-Mail"
End Sub
Private Sub CommandButton2_Click()
CommandButton2.BackColor = RGB(255, 255, 0) 'Yellow
Worksheets("Odgovori").Range("H6").Value = "Adresa"
End Sub