Find proper case put delimiter after upper case

shrinivasmj

Board Regular
Joined
Aug 29, 2012
Messages
140
I have a data in A coloum , NEED FORMULA OR VB TO PUT DELIMITER BETWEEN UPPER CASE AND PROPER

2133 JOSEPH DAMON DR Magadan Miass (8)862
624 WOODLAND TRAILS DR Krasnoyarsk Kirsanov 4862
29 WASHINGTON ST. Magadan Cherepovets 8652
19441 134TH AVE. S.E. Tjumen Zavolzhye 84722

EG

NEED TO PUT THE DELIMATER ( ^ ) AS SHOWN BELOW

2133 JOSEPH DAMON DR ^ Magadan Miass (8)862
624 WOODLAND TRAILS DR ^ Krasnoyarsk Kirsanov 4862
29 WASHINGTON ST. ^ Magadan Cherepovets 8652
19441 134TH AVE. S.E. ^ Tjumen Zavolzhye 84722
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Re: Find proper case put dilimater afetr upper case

Are there always three groups of letters and/or numbers in the proper case section?
 
Upvote 0
Re: Find proper case put dilimater afetr upper case

just put delimater after upper case ^

This does NOT answer my question! I understand what you want to do. In order to be able to help, we need to know if the format of the text in proper case in your sample data will always be the same, i.e. three groups of letters/numbers, like Krasnoyarsk Kirsanov 4862.
 
Upvote 0
Re: Find proper case put dilimater afetr upper case

yes same as seen

or else find proper case and put delimeter before it
 
Upvote 0
Re: Find proper case put dilimater afetr upper case

Sub MG14Dec48
Dim str As String, n As Long, nStr As String
str = [a1]
For n = Len([a1]) To 1 Step -1
If Mid(str, n, 1) = " " Then
If Mid(str, n - 1, 1) = UCase(Mid(str, n - 1, 1)) Then
nStr = Left(str, n - 1) & " { " & Right(str, Len(str) - n)
Exit For
End If
End If
Next n
Range("A2").Value = nStr
End Sub

ITworking for a2 cell only can u make it
 
Upvote 0
Re: Find proper case put dilimater afetr upper case

You should have said that you wanted a VBA solution in your thread title! Please be patient.
 
Upvote 0
Re: Find proper case put dilimater afetr upper case

You could use this UDF.
FindCaseWord will find the first location of the first word that is in the indicated case.
Note that "1234" is in Proper Case. It is also in lower case and UPPER CASE. Use of the IgnoreNumerals argument.
Note also that "A123" is not a numeral and it is in both UPPER and Proper cases

Use the formula =REPLACE(A1,FIndCaseWord(3, A1),0,"^ ")

Code:
Function FindCaseWord(find_Case As VbStrConv, within_String As String, _
        Optional IgnoreNumerals As Boolean = True, Optional Delimiter As String = " ") As Long
    Rem 1 - upper case, 2 - lower case, 3 - proper case
    Dim i As Long
    Dim Words As Variant
    Dim Prefix As String
    Words = Split(within_String, Delimiter)
    For i = 0 To UBound(Words)
        If IgnoreNumerals And (LCase(Words(i)) = UCase(Words(i))) Then
            Prefix = Prefix & Delimiter & Words(i)
        ElseIf StrConv(Words(i), find_Case) = Words(i) Then
            FindCaseWord = Len(Prefix) + 1
            Exit For
        Else
            Prefix = Prefix & Delimiter & Words(i)
        End If
    Next i
End Function
 
Last edited:
Upvote 0
Re: Find proper case put dilimater afetr upper case

FO BELOW DATA ITS NOT WORKING

1623 PINKNEY STREET Self-Employed 222

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,790
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top