View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kemal@intelinfo.zzn.com is offline
external usenet poster
 
Posts: 27
Default Filter and fill cells based on criteria

I hope your rows count is not many.As below codes
- though will do the job - will repeat unnecassarly doing the same
thing.
Will check columns B,C, F if found any "X" then will "X" all over
again
even if it did it before.Sory for trusting your cpu too much.
rgds


sub makex()

Dim rng As Range
Dim i As Range
Dim i1 As Range

Application.EnableEvents = False
Application.ScreenUpdating = False

With Worksheets("yoursheet")' please change
Set rng = .Range("a2", .Range("a" & _
Rows.Count).End(xlUp))
End With

For Each i In rng
If WorksheetFunction.IsText(i.Value) _
Then GoTo asd
If i.Value = Int(i.Value) _
And i.Value <= 100 Then
If i.Offset(, 1).Value = _
"X" Or i.Offset(, 2).Value = _
"X" Or i.Offset(, 5).Value = "X" Then
For Each i1 In rng
If i1.Value = i.Value Then
i1.Offset(, 1).Value = "X"
i1.Offset(, 2).Value = "X"
i1.Offset(, 5).Value = "X"
End If
Next i1
End If
End If
asd: Next i

Application.EnableEvents = True
Application.ScreenUpdating = True

end sub