Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Leave last col alone
David,
Difficult to test, but does this do it With Worksheets(i) cols = .UsedRange.Columns.Count Set Rng = .Range(.Cells(3, 1), .Cells(Rows.Count, 1).End(xlUp).Offset(-2, 0)) For Each c In Rng If c = old_Member Then Range(Cells(c.Row, "A"), Cells(c.Row, cols - 1)).ClearContents End If Next c Rng.Resize(, cols).Sort Key1:=.Range("A1"), Order1:=xlAscending End With -- HTH Bob Phillips "David Turner" wrote in message ... Using XL2000 I use the following code to delete a chosen member from a range on several sheets: With Worksheets(i) cols = .UsedRange.Columns.Count Set Rng = .Range(.Cells(3, 1), .Cells(Rows.Count, 1).End(xlUp).Offset(-2, 0)) For Each c In Rng If c = Old_Member Then .Rows(c.Row).ClearContents End If Next c Rng.Resize(, cols).Sort Key1:=.Range("A1"), Order1:=xlAscending End With I just discovered that it also clears a needed formula in the last column. How can I leave that column alone? -- David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Total Leave | Excel Worksheet Functions | |||
calculating Leave | Excel Worksheet Functions | |||
Annual leave | Excel Discussion (Misc queries) | |||
Leave Log | Excel Discussion (Misc queries) | |||
Time To Leave | Excel Discussion (Misc queries) |