Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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
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
Total Leave Tia[_3_] Excel Worksheet Functions 6 January 15th 09 10:24 AM
calculating Leave Tia[_3_] Excel Worksheet Functions 12 July 25th 08 10:20 AM
Annual leave [email protected] Excel Discussion (Misc queries) 3 March 12th 08 02:20 PM
Leave Log CiceroCF Excel Discussion (Misc queries) 1 January 10th 07 07:25 PM
Time To Leave Nicholas Scarpinato Excel Discussion (Misc queries) 3 June 20th 05 10:18 PM


All times are GMT +1. The time now is 05:54 AM.

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

About Us

"It's about Microsoft Excel"