Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I want a macro to insert a peroid after any single alpha character in a list of names in a column. I have a list of names but single alpha characters such as middle initials don't have a period after it. Can this be done? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() With your names in ColA; try the below macro Sub Macro() lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row For lngRow = 1 To lngLastRow arrData = Split(Range("A" & lngRow), " ") For intTemp = 0 To UBound(arrData) If Len(arrData(intTemp)) = 1 Then arrData(intTemp) = arrData(intTemp) & "." End If Next Range("A" & lngRow) = Join(arrData, " ") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Aposto" wrote: I want a macro to insert a peroid after any single alpha character in a list of names in a column. I have a list of names but single alpha characters such as middle initials don't have a period after it. Can this be done? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks works like a charm! "Jacob Skaria" wrote: With your names in ColA; try the below macro Sub Macro() lngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row For lngRow = 1 To lngLastRow arrData = Split(Range("A" & lngRow), " ") For intTemp = 0 To UBound(arrData) If Len(arrData(intTemp)) = 1 Then arrData(intTemp) = arrData(intTemp) & "." End If Next Range("A" & lngRow) = Join(arrData, " ") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Aposto" wrote: I want a macro to insert a peroid after any single alpha character in a list of names in a column. I have a list of names but single alpha characters such as middle initials don't have a period after it. Can this be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Leading Characters If String Is Only 7 Characters | Excel Discussion (Misc queries) | |||
Insert characters into String | Excel Programming | |||
Macro to delete row based on criteria (first few characters of string) | Excel Programming | |||
use macro to insert characters at the beginning of a string | Excel Programming | |||
Insert characters in a text string | Excel Worksheet Functions |