Sub tgr()
MsgBox Range("B1:F1").SpecialCells(xlCellTypeVisible).Count
MsgBox Range("B2:F2").SpecialCells(xlCellTypeVisible).Count
MsgBox Range("B3:F3").SpecialCells(xlCellTypeVisible).Count
MsgBox Range("B100:F100").SpecialCells(xlCellTypeVisible).Count
End Sub
첨부한 그림에서 D는 열이 숨겨진거여서, SUBTOTAL 상관없이 무조건 합계가 계산됩니다
https://support.microsoft.com/ko-kr/office/subtotal-%ED%95%A8%EC%88%98-7b027003-f060-4ade-9040-e478765b9939
만약에 범위에서 몇개인지 확인만 해도 되는 작업이라면, 범위 선택하신 다음
Alt + ; 를 누르면 보이는 셀만 선택되면서, 오른쪽 아래에 개수가 몇개인지 확인하실 수 있습니다.
아니면 vba로..
Sub tgr() MsgBox Range("B1:F1").SpecialCells(xlCellTypeVisible).Count End Subvba 사용 시 계산할 셀이 많을 경우
연속 지정해도 될런지요 ?
Sub tgr() MsgBox Range("B1:F1").SpecialCells(xlCellTypeVisible).Count MsgBox Range("B2:F2").SpecialCells(xlCellTypeVisible).Count MsgBox Range("B3:F3").SpecialCells(xlCellTypeVisible).Count MsgBox Range("B100:F100").SpecialCells(xlCellTypeVisible).Count End Sub