PDA

View Full Version : Sleeper: Advance Filter with command button



tqm1
05-10-2007, 06:14 PM
Dear Experts

On worksheet, Find button Display many of records instead given criteria in A1

Please reveiw attachment and help

shasur
05-11-2007, 03:21 AM
Here is the changed snippet



' With shData.Columns("A:H").Rows("2:9999")
With shData.Columns("A:A").Rows("2:9999") 'Changed By Shasur
Set mycell = .Find(stringToLookFor, LookIn:=xlValues)
If Not mycell Is Nothing Then
firstAddress = mycell.Address
Do
'if mycell = stringtolookfor then
myFoundRow = mycell.Row
shData.Range("a" & myFoundRow & ":H" & myFoundRow).Copy _
Destination:=sh.Cells(myrow, 1)
myrow = myrow + 1
'Set mycell = shData.Columns("A:H").FindNext(mycell)
Set mycell = shData.Columns("A:H").FindNext(mycell) 'Changed By Shasur
Loop While Not mycell Is Nothing _
And mycell.Address <> firstAddress
Else
MsgBox ("Nothing Found")
End If
End With