This code will hide certain columns if they are shown and show them if they are hidden.
Is this the best way to do it? Or is there a simpler way?
<font face=Courier New>
<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Show_Hide_Notes_Click()
<SPAN style="color:#00007F">Dim</SPAN> ActCell <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
Application.ScreenUpdating = <SPAN style="color:#00007F">False</SPAN>
ActCell = ActiveCell.Address
<SPAN style="color:#00007F">If</SPAN> Range("D:F").Columns.Hidden = <SPAN style="color:#00007F">False</SPAN> <SPAN style="color:#00007F">Then</SPAN>
Columns("D:F").Select
Selection.EntireColumn.Hidden = <SPAN style="color:#00007F">True</SPAN>
Show_Hide_Notes.Caption = "Show Notes"
Show_Hide_Notes.BackColor = &H8000&
Show_Hide_Notes.ForeColor = &HFFFFFF
<SPAN style="color:#00007F">Else</SPAN>
Columns("D:F").Select
Selection.EntireColumn.Hidden = <SPAN style="color:#00007F">False</SPAN>
Show_Hide_Notes.Caption = "Hide Notes"
Show_Hide_Notes.BackColor = &HFFFF&
Show_Hide_Notes.ForeColor = &H0&
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
Range(ActCell).Select
Application.ScreenUpdating = <SPAN style="color:#00007F">True</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>
Is this the best way to do it? Or is there a simpler way?
<font face=Courier New>
<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Show_Hide_Notes_Click()
<SPAN style="color:#00007F">Dim</SPAN> ActCell <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
Application.ScreenUpdating = <SPAN style="color:#00007F">False</SPAN>
ActCell = ActiveCell.Address
<SPAN style="color:#00007F">If</SPAN> Range("D:F").Columns.Hidden = <SPAN style="color:#00007F">False</SPAN> <SPAN style="color:#00007F">Then</SPAN>
Columns("D:F").Select
Selection.EntireColumn.Hidden = <SPAN style="color:#00007F">True</SPAN>
Show_Hide_Notes.Caption = "Show Notes"
Show_Hide_Notes.BackColor = &H8000&
Show_Hide_Notes.ForeColor = &HFFFFFF
<SPAN style="color:#00007F">Else</SPAN>
Columns("D:F").Select
Selection.EntireColumn.Hidden = <SPAN style="color:#00007F">False</SPAN>
Show_Hide_Notes.Caption = "Hide Notes"
Show_Hide_Notes.BackColor = &HFFFF&
Show_Hide_Notes.ForeColor = &H0&
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
Range(ActCell).Select
Application.ScreenUpdating = <SPAN style="color:#00007F">True</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>