Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Filter and fill cells based on criteria

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I filter the cells based in Fill color? Ravi Excel Discussion (Misc queries) 2 April 28th 10 12:47 PM
Pop Up box to filter based on User Criteria Darin Kramer Excel Programming 0 February 22nd 06 12:43 PM
Fill cells with color based on criteria in two cells AA Excel Worksheet Functions 2 January 2nd 06 11:29 PM
Filter/copy based on criteria gavmer[_86_] Excel Programming 0 October 5th 04 12:32 AM
Filter/copy based on criteria gavmer[_84_] Excel Programming 0 October 1st 04 03:14 AM


All times are GMT +1. The time now is 07:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"