用按钮的方法较好,代码如下,详见附件
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "隐藏列" Then
Columns("G:AB").Hidden = True
CommandButton1.Caption = "显示列"
Else
Columns("G:AB").Hidden = False
CommandButton1.Caption = "隐藏列"
End If
End Sub