Filter and fill cells based on criteria

M

Mrpush

Hi,

Having a little trouble.

I need to be able to select records in a sheet based on the same criteria in
one column.

I then need to look at all the values for the selected records in other
colums, and if a particular value exists I need to change all the cells in
that colum to that value.

Example:

1.) Select all records that have record ID of "1" in column A and show only
those records.

2.) In columns B (and C-F), if an "X" appears in any of the column cells,
then change all of these cells to a "X".

3.) repeat process for record Id's of 2 through 100 in Column A.

Seems simple, but I cannot figure it out.

Any ideas?

Thanks much,

Mark
 
K

kemal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top