PC Review


Reply
Thread Tools Rate Thread

Delete part of cell value

 
 
Sinner
Guest
Posts: n/a
 
      26th May 2008
Hi,

Below code removes word 'SADMIN' if found as part of a word or in each
cell of column M of
sheet2.
----------------------------------------------------------------------
Sub RMV_SADMIN()
Application.ScreenUpdating = False
Application.DisplayAlerts = False


For Each Cell In Range("sheet2!M:M")


sStr = Trim(Cell.Value)
If Left(sStr, 6) = "SADMIN" Then
Cell.Value = Trim(Right(sStr, Len(sStr) - 6))


End If


Next


Application.ScreenUpdating = True
Application.DisplayAlerts = True


Worksheets("Sheet2").Activate
Range("A1").Select


End Sub
-----------------------------------------------------------------


Any further improvement is welcomed.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete part of cell value Sinner Microsoft Excel Programming 2 26th May 2008 10:39 PM
Delete part of a cell Francis Microsoft Excel Worksheet Functions 5 1st Feb 2008 07:58 PM
Delete Part of Cell? Odysseus Microsoft Excel Programming 2 1st Nov 2004 03:04 PM
Delete Part of Cell? Odysseus Microsoft Excel Programming 2 1st Nov 2004 02:45 PM
Delete part of a cell value Mike Microsoft Excel Discussion 3 9th Jan 2004 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 AM.