Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Am Mon, 29 Oct 2012 10:47:47 +0000 schrieb shrinivasmj: EG NAME INOUT AND OUTPUT Srinivas SRINIVAS srinivas m M,SRINIVAS srinivas m.j. J,SRINIVAS M. srinivas m.j.h. J.H,SRINIVAS M. srinivas m. j. h. k. H. K,SRINIVAS M. J. srinivas m. j. h. k. l. H. K. L,SRINIVAS M. J. try it with VBA (modify to suit): Sub RevStr() Dim c As Range Dim LRow As Long Dim mySearch As Integer Dim Start As Integer LRow = Cells(Rows.Count, 1).End(xlUp).Row For Each c In Range("A1:A" & LRow) If InStr(c, ".") = 0 And InStr(Trim(c), " ") 0 Then mySearch = 2 Else mySearch = Len(c) - Len(Replace(c, ".", "")) + 1 End If Select Case mySearch Case 2 Start = WorksheetFunction.Find(" ", c) + 1 c = Mid(c, Start, 99) & ", " & Left(c, Start - 2) Case 3, 4 c = WorksheetFunction.Substitute(c, ".", "#", 1) Start = WorksheetFunction.Find("#", c) + 1 c = Mid(c, Start, 99) & ", " & Left(c, Start - 2) & "." Case 5, 6, 7, 8, 9, 10 c = WorksheetFunction.Substitute(c, ".", "#", 2) Start = WorksheetFunction.Find("#", c) + 1 c = Mid(c, Start, 99) & ", " & Left(c, Start - 2) & "." End Select c = UCase(Trim(c)) Next End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert lower to upper case automatically without using UPPER | Excel Discussion (Misc queries) | |||
Changing upper case characters to upper/lower | Excel Discussion (Misc queries) | |||
Changing file in all upper case to upper and lower case | Excel Discussion (Misc queries) | |||
Change the text from lower case to upper case in an Excel work boo | Excel Discussion (Misc queries) | |||
How do I convert all upper case excel sheet into upper and lower . | Excel Discussion (Misc queries) |