|
▼catcom さん:
> With Range("A1").CurrentRegion
> .Worksheet.AutoFilterMode = False
> .AutoFilter Field:=1, Criteria1:="<>000000"
> .AutoFilter Field:=6, Criteria1:="=000"
> cnt2 = .Columns(1).SpecialCells(xlVisible).Count
> .AutoFilter
> End With
>
> With Range("A1").CurrentRegion
> .Worksheet.AutoFilterMode = False
> .AutoFilter Field:=1, Criteria1:="<>000000"
>
> Dim cnt1 As Long
> cnt1 = Range("a1:a" & Cells(65530, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Count
> End With
>
> MsgBox "行数:" & cnt1 & _
> Chr(10) & _
> "000: " & cnt2 - 1
>
> にやってみたらできました。
そうですか、
ということは、
> Dim cnt1 As Long
Dim cnt2 As Long
> With Range("A1").CurrentRegion
> .Worksheet.AutoFilterMode = False
> .AutoFilter Field:=1, Criteria1:="<>000000"
cnt1 = .Columns(1).SpecialCells(xlVisible).Count - 1
> .AutoFilter Field:=6, Criteria1:="=000"
> cnt2 = .Columns(1).SpecialCells(xlVisible).Count - 1
> .AutoFilter
> End With
MsgBox "行数:" & cnt1 & vbLf & _
> "000: " & cnt2
ってことです。よね?
|
|