با سلام و احترام
دستور vba برای پیدا کردن آخرین سطر پر شده یک جدول بعد از اعمال فیلتر
با تشکر
دستور vba برای پیدا کردن آخرین سطر پر شده یک جدول بعد از اعمال فیلتر
با تشکر
Sub FilterTblTrading() Dim TextFilter As String TextFilter = Cells(2, 2).Value ActiveSheet.ListObjects("Tbl_Name").Range.AutoFilter Field:=2, _ Criteria1:=TextFilter LRAfterfilt = ActiveSheet.ListObjects("Tbl_Name").Range.End(xlUp).Row End Sub Sub CountVisM() FilterTblTrading Dim LIstOb As ListObject Dim LastRow As ListRow Set LIstOb = ActiveSheet.ListObjects(1) Set LastRow = VisibleRow(LIstOb, 3) If Not LastRow Is Nothing Then MsgBox LastRow.Range.Address If Not LastRow Is Nothing Then MsgBox LastRow.Range.Row End Sub Function VisibleRow(LIstOb As ListObject, Idx As Long) As ListRow Dim RwCnt As Long Dim LastRow As ListRow If Idx <= 0 Then Exit Function For Each LastRow In LIstOb.ListRows If LastRow.Range.EntireRow.Hidden = False Then RwCnt = RwCnt + 1 If Idx = RwCnt Then Set VisibleRow = LastRow Exit For End If End If Next End Function
کامنت