我有一个包含少数分组列的Excel。在该组内部,几列是HIDDEN。(右键单击隐藏)。折叠组时。所有列的隐藏属性都返回true,这是我不想要的。除了折叠组中的其他组列之外,是否有方法可以识别最初的隐藏列?
答案 0 :(得分:2)
不完全理解这个问题但是在VBA中我可以测试一下列是否像这样隐藏:
Option Explicit
Sub TestFunction()
'hide a few columns and then run me<<<<<<<<<<
Dim mySearchColumn As Integer
mySearchColumn = (CInt(Application.InputBox("input a column number")))
MsgBox ("you wanted to know about column " & mySearchColumn & ". Is it hidden: " & IsColumnHidden(mySearchColumn))
End Sub
Function IsColumnHidden(targetColumn As Integer) As Boolean
IsColumnHidden = False
If Columns(targetColumn).EntireColumn.Hidden Then
IsColumnHidden = True
End If
End Function