接入您的代碼試看, 但由於不知篩選的實際區域,下面代碼是以[a1]為準
Sub zz()
If ActiveSheet.FilterMode = True Then
Set rng = [a1].CurrentRegion
zr = rng.Rows.Count
zc = rng.Columns.Count
For i = 2 To zr
If rng.Cells(i, 1).RowHeight > 0 Then Exit For
Next
MsgBox rng.Cells(i, 1).Address(0, 0) & ":" & rng.Cells([a1].End(4).Row, zc).Address(0, 0)
End If
End Sub作者: toromru 時間: 2015-8-19 16:52
Sub zz()
If ActiveSheet.FilterMode = True Then
Set rng = [a1].CurrentRegion
zr = rng.Rows.Count
zc = rng.Columns.Count
For i = 2 To zr
If rng.Cells(i, 1).RowHeight > 0 Then Exit For
Next
MsgBox rng.Cells(i, zc).Address(0, 0) & ":" & rng.Cells([a1].End(4).Row, zc).Address(0, 0)
End If
End Sub作者: 准提部林 時間: 2015-8-22 18:01
Set fa = [d2:d65536].SpecialCells(xlCellTypeVisible)(1)
Set fb = [D65536].End(xlUp)
MsgBox fa.Address(0, 0) & ":" & fb.Address(0, 0)
MsgBox fa.Row & ":" & fb.Row