Hi, You can try the following VBA code. Sincerely , ASD
* * * Sub PutPeriods() Dim lpString As String Dim lpActiveString As String Dim iCount As Integer lpString = Space(2) & Trim(ActiveCell) lpActiveString = "" For iCount = 1 To Len(lpString) Step 1 If iCount Mod 3 <> 0 Then lpActiveString = lpActiveString & Mid(lpString, iCount, 1) _ Else lpActiveString = lpActiveString & Mid(lpString, iCount, 1) & "." Next iCount lpActiveString = Trim(lpActiveString) MsgBox lpActiveString End Sub 2008/10/1 <[EMAIL PROTECTED]> > > I need a macro that will add periods at specific locations in a cell > of text in Excel. My example is an item number f123456789 that I need > to look like f.123.456.789. Any suggestions? I have code written but > it is bulky and I know there is an easier way. Thanks for any and all > help. > > > > --~--~---------~--~----~------------~-------~--~----~ Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To post to this group, send email to excel-macros@googlegroups.com For more options, visit this group at http://groups.google.com/group/excel-macros?hl=en Visit & Join Our Orkut Community at http://www.orkut.com/Community.aspx?cmm=22913620 Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com To see the Daily Excel Tips, Go to: http://exceldailytip.blogspot.com -~----------~----~----~----~------~----~------~--~---