Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2007

Tip: Looking for answers? Try searching our database.

macro to change column to keep only last 5 characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S Himmelrich - 06 Dec 2007 21:33 GMT
I'm not sure how I can use left or right or trim on this, but any
suggestions?
Gord Dibben - 06 Dec 2007 21:54 GMT
Formula method.

Assuming data in column A,  in B1 enter  =RIGHT(A1,5) and double-click fill
handle to copy down.

Macro method.  You choose the activecell.

Sub trimmit()
Dim rng As Range
Set rng = Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp))
         For Each cell In rng
   cell.Value = Right(cell.Value, 5)
Next
End Sub

Gord Dibben  MS Excel MVP

>I'm not sure how I can use left or right or trim on this, but any
>suggestions?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.