본문 바로가기
Excel&VBA/VBA

VBA) 데이터 전체 행/열 구하기

by 센텀Dev 2021. 4. 6.

Dim sht As Worksheet

Set sht = ActiveWorkbook.sheets ("매핑생성")

'필터해제
If sht.FilterMode = True Then
   sht.ShowAllData
End If

1)
rowcnt = sht.Range("b65536").End(xlUp).Row
colcnt = sht.Rnage("A1").End(xlToRight).Column

2)
With sht.UsedRange
   rowcnt = .Rows.Count
   colcnt = .Columns.Count
End With

'Excel&VBA > VBA' 카테고리의 다른 글

VBA) 그룹 자동화  (0) 2022.10.07
VBA) 전각문자 치환  (0) 2022.07.18
[VBA] 문자 분리하기(split)  (0) 2018.02.13