Hi Skanda, Using worksheet funtions, it would just be:
=MID(B6,7,19) copied down. Programatically it would include a For/Next loop, but the otherwise look very similar: Sub SevenToTwentyfive() For i = 6 To 1000 Cells(i, 3) = Mid(Cells(i, 2), 7, 19) Next i End Sub This would put the trimmed result into Col C. But you can over-write the original data if you don't need the extra info, by changing the red 3 for a 2. This can't be done with worksheet functions. The other advantage to using VBA is that the worksheet doesn't have to be loaded with 1000 formulas. Regards - Dave. Date: Sun, 1 Aug 2010 11:49:27 -0400 Subject: $$Excel-Macros$$ Sort and then extract digits from 7 to 25 From: skanda.pokkun...@gmail.com To: excel-macros@googlegroups.com Hi All, The report that I generate is sorted on column "S" and then it is hidden using VBA code.After the sorting is done I want to display only characters from 7 to 25 from row b6 to B1000. Eg. PM 00 0000 New York,NY. We need to diaplay only 0000 New York,NY.How to do this programatically? Thanks, Skanda. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 7000 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 7000 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe