IronM
New Member
- Joined
- Jan 20, 2022
- Messages
- 15
- Office Version
- 365
- 2019
- Platform
- Windows
So, this is a followup question of this thread.
I have now this code:
Is there a way to add to this code to a button so when I click once it will write Forecast on it and click second will show Planned and cycle between these 2 at each press (considering the default (column 3) is Planned?
Doesn't necessary needs to be a visual change of the design of the button but at least for the text to appear so I know on which column the name range moved to.
Thank you!
I have now this code:
VBA Code:
Sub IronM()
If Range("Plan").Column = 3 Then
ThisWorkbook.Names("Plan").RefersTo = Range("Plan").Offset(, 1)
Else
ThisWorkbook.Names("Plan").RefersTo = Range("Plan").Offset(, -1)
End If
End Sub
Is there a way to add to this code to a button so when I click once it will write Forecast on it and click second will show Planned and cycle between these 2 at each press (considering the default (column 3) is Planned?
Doesn't necessary needs to be a visual change of the design of the button but at least for the text to appear so I know on which column the name range moved to.
Thank you!