Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I filter the cells based in Fill color? | Excel Discussion (Misc queries) | |||
Pop Up box to filter based on User Criteria | Excel Programming | |||
Fill cells with color based on criteria in two cells | Excel Worksheet Functions | |||
Filter/copy based on criteria | Excel Programming | |||
Filter/copy based on criteria | Excel Programming |