استبدل أخى كود كشف_حساب بالكود التالى:
وذلك ابتداء من dim mo as string
Dim mo As String
Dim Lr As Long, i As Long
Dim r As Integer
mo = Range("b3").Value
sh = [b2]
Range("a5:e1000").ClearContents
Application.ScreenUpdating = False
With ActiveSheet
Lr = Sheets(sh).Cells(.Rows.Count, "b").End(xlUp).Row
For i = 3 To Lr
If mo = CStr(Sheets(sh).Cells(i, "b")) And Sheets(sh).Cells(i, "f") >= [d3] And Sheets(sh).Cells(i, "f") <= [e3] Then
r = r + 1
Cells(r + 4, "a").Value = Sheets(sh).Cells(i, "f").Value
Cells(r + 4, "b").Value = Sheets(sh).Cells(i, "d").Value
Cells(r + 4, "c").Value = Sheets(sh).Cells(i, "c").Value
Cells(r + 4, "d").Value = Sheets(sh).Cells(i, "g").Value
Cells(r + 4, "e").Value = Sheets(sh).Cells(i, "h").Value
End If
Next
End With
Run "btnSort_Click"
Run "OnFiltercashf"
End Sub
أرجو أن يكون هذا طلبك