Hello
can anyone tell me why I can not activate these two macros together?
Sub macros2222223()
HideUnhideColumns
HideUnhideRows
End Sub 'not working
Sub HideUnhideColumns()
Dim myBTN As Button, cll As Range
With ActiveSheet
Set myBTN = .Buttons(Application.Caller)
If Trim(UCase(myBTN.Caption)) = "HIDE" Then
For Each cll In .Range("Sum").Cells
cll.EntireColumn.Hidden = cll.Value = 0
Next cll
myBTN.Caption = "Show"
Else
.Range("Sum").EntireColumn.Hidden = False
myBTN.Caption = "Hide"
End If
On Error Resume Next
.UsedRange.Cells.SpecialCells(xlCellTypeVisible).EntireColumn.AutoFit
On Error GoTo 0
End With
End Sub
Sub HideUnhideRows()
Dim myBTN As Button, cll As Range
With ActiveSheet
Set myBTN = .Buttons(Application.Caller)
If Trim(UCase(myBTN.Caption)) = "HIDE" Then
For Each cll In .Range("Num").Cells
cll.EntireRow.Hidden = cll.Value = ""
Next cll
myBTN.Caption = "Show"
Else
.Range("Num").EntireRow.Hidden = False
myBTN.Caption = "Hide"
End If
On Error Resume Next
.UsedRange.Cells.SpecialCells(xlCellTypeVisible).EntireRow.AutoFit
On Error GoTo 0
End With
End Sub
Sub CallprobMacs()
Call HideprobUnhideColumns
Call HideprobUnhideRows
End Sub 'not working
Sub runall1()
Application.Run "HideUnhideColumns"
Application.Run "HideUnhideRows"
End Sub 'not working