|
hi Zhao老师,请教一个问题。我这边有一段程序,不能excel add-in 加载成功,能否劳驾您有空帮忙看下,需要如何调试 ,才能运行成功,非常感谢。- Sub hide_column()
- Dim rows, cols As Integer
- 'batch all sheets in this workbook
-
- With ActiveWorkbook
-
- For Each sh In .Worksheets
- 'read all sheets except the two sheets
- If sh.Name <> "Cover Page" And sh.Name <> "Summary" Then
- With sh
- 'Unprotect the active sheet
- .Unprotect
-
- 'get row number
- rows = .[A65536].End(xlUp).Row
-
- 'get column number
- 'cols = .[IV1].End(xlToLeft).Column
- cols = .UsedRange.Columns.Count
-
- 'hide the column with character--rev_raised
- For j = 1 To cols
- If InStr(.Cells(4, j), "rev_raised") > 0 Then .Columns(j).EntireColumn.Hidden = True
- Next j
-
- End With
- End If
- Next sh
-
- End With
- End Sub
-
-
- Sub show_all_column()
- Dim rows, cols As Integer
-
- With ActiveWorkbook
-
- For Each sh In .Worksheets
- 'read all sheets except the two sheets
- If sh.Name <> "Cover Page" And sh.Name <> "Summary" Then
- With sh
- rows = .[A65536].End(xlUp).Row 'get row number
-
- 'get column number
- 'cols = .[IV1].End(xlToLeft).Column
- cols = .UsedRange.Columns.Count
-
- 'show all columns
- For j = 1 To cols
-
- .Columns(j).Hidden = False
-
- Next j
-
- End With
- End If
- Next sh
-
- End With
- End Sub
复制代码 |
|