Hi,
I have a Column F that is defaulted to be hidden. I have an arrow that is rightward facing and if I click on it, I want Column F to be shown and the arrow to rotate to face leftward. Then if I click on it again, Column F is hidden again and the arrow becomes rightward facing.
I have the code below which works individually for each, but when I combine to 1 macro they cancel each other out so to speak. Any ideas how I get around this to accomplish what I described above?
Thanks!
Sub ExpandColumnF()
If Shapes("Shape1").Rotation = 0 Then
Range("ColumnF").Select
Range("ColumnF").EntireColumn.Hidden = False
Shapes("Shape1").Rotation = 180
Range("E1").Select
End If
End Sub
Sub ContractColumnF()
If Shapes("Shape1").Rotation = 180 Then
Range("ColumnF").Select
Range("ColumnF").EntireColumn.Hidden = True
Shapes("Shape1").Rotation = 0
Range("E1").Select
End If
End Sub
Sub ColumnF()
ExpandColumnF
ContractColumnF
End Sub
I have a Column F that is defaulted to be hidden. I have an arrow that is rightward facing and if I click on it, I want Column F to be shown and the arrow to rotate to face leftward. Then if I click on it again, Column F is hidden again and the arrow becomes rightward facing.
I have the code below which works individually for each, but when I combine to 1 macro they cancel each other out so to speak. Any ideas how I get around this to accomplish what I described above?
Thanks!
Sub ExpandColumnF()
If Shapes("Shape1").Rotation = 0 Then
Range("ColumnF").Select
Range("ColumnF").EntireColumn.Hidden = False
Shapes("Shape1").Rotation = 180
Range("E1").Select
End If
End Sub
Sub ContractColumnF()
If Shapes("Shape1").Rotation = 180 Then
Range("ColumnF").Select
Range("ColumnF").EntireColumn.Hidden = True
Shapes("Shape1").Rotation = 0
Range("E1").Select
End If
End Sub
Sub ColumnF()
ExpandColumnF
ContractColumnF
End Sub
Last edited: