The Animal
Active Member
- Joined
- May 26, 2011
- Messages
- 449
Hi.
I would like to create a toggle button but instead of selecting the columns to toggle (as per below "Range("D:E").Columns.Hidden = Not Range("D:E").Columns.Hidden") I would like to toggle on cell color so then you can quickly fill and unfill the cells in row 1 and toggle would use a color value rather than pre-determined columns.
If we use color below RGB
Red: 204
Green: 255
Blue: 204
Sub TogglePartNo()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True
Range("D:E").Columns.Hidden = Not Range("D:E").Columns.Hidden
End Sub
Any help would be great
Thanks Stephen
I would like to create a toggle button but instead of selecting the columns to toggle (as per below "Range("D:E").Columns.Hidden = Not Range("D:E").Columns.Hidden") I would like to toggle on cell color so then you can quickly fill and unfill the cells in row 1 and toggle would use a color value rather than pre-determined columns.
If we use color below RGB
Red: 204
Green: 255
Blue: 204
Sub TogglePartNo()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True
Range("D:E").Columns.Hidden = Not Range("D:E").Columns.Hidden
End Sub
Any help would be great
Thanks Stephen