Hi
I'm currently working on a budget scheme, where I've created a listbox when the documents open. There you'll have to choose which month you're making a budget for.
Now I need a macro, that if they change the month then some other cells would have to change their text color. But it should only happen if the month they choose, is not the same as the month that is already in the cell.
example. Last time the document was saved, the month was december. If they choose december when they open the document now, nothing should happen. But if they choose everyother month, cell A1 should change text color.
Currently I've the following code:
D3 is the month of the budget
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cellToChange As Range
Set cellToChange = Range("D3")
'If Target.Address = cellToChange.Address Then
Range("A1").Font.Color = vbRed
'End If
I'm currently working on a budget scheme, where I've created a listbox when the documents open. There you'll have to choose which month you're making a budget for.
Now I need a macro, that if they change the month then some other cells would have to change their text color. But it should only happen if the month they choose, is not the same as the month that is already in the cell.
example. Last time the document was saved, the month was december. If they choose december when they open the document now, nothing should happen. But if they choose everyother month, cell A1 should change text color.
Currently I've the following code:
D3 is the month of the budget
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cellToChange As Range
Set cellToChange = Range("D3")
'If Target.Address = cellToChange.Address Then
Range("A1").Font.Color = vbRed
'End If