I have a userform to filter the multiple criteria insteadnof filtering . In another spreadsheet , it needs to set target for particular group. But however when I filter the second time , empty blanks will apppear as empty . Let just say in first selection , 10000 rows appear in column 6 .but when I select again of different option, and 400 data appear , for rows 401-10000 will appear as false. Thanks in advanced .
Sub Macro1()
Dim Row As Integer
Dim Blank As Integer
Row = 2
Blank = 0
With Sheet4
Do While Blank <= 5
If .Cells(Row, 5).Value = "CAT" Then
.Cells(Row, 6).Value = "9"
Row = Row + 1
ElseIf .Cells(Row, 5).Value = "DOG" Then
.Cells(Row, 6).Value = "35"
Row = Row + 1
ElseIf .Cells(Row, 5).Value = "RABBIT" Then
.Cells(Row, 6).Value = "50"
Row = Row + 1
ElseIf .Cells(Row, 5).Value = "OTTER" Then
.Cells(Row, 6).Value = "6"
Row = Row + 1
Else
.Cells(Row, 6).Value = "2"
Row = Row + 1
End If
'--- For detect end of row
If .Cells(Row, 5).Value = "" Then
Blank = 6
Else
'--- Reset
Blank = 0
End If
Loop
End With
End Sub
Bookmarks