Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() On Tue, 6 Jan 2009 13:06:06 -0800, David wrote: Is it possible to write a macro that will change cells that have "Last Name, First Name, Middle Initial" to "First Name, Middle Initial, Last Name" ? Thank you for your help. David Yes it is. Are you certain the data format is exactly as you have provided? i.e. All cells have exactly three segments separated by commas. Are you certain you want to have commas separating the segments in the result? At its simplest, you could use something like: ============== Option Explicit Sub FixName() Dim c As Range Dim s For Each c In Selection s = Split(c.Text, ",") c.Value = s(1) & ", " & s(2) & ", " & s(0) Next c End Sub ================== Of course, since your original and result formats are identical, you'd have to set up a routine to ensure that you didn't run the macro twice on the same cell. --ron |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change the series order in a LEGEND ONLY...not data | Charts and Charting in Excel | |||
Change order of data in a cell | Excel Discussion (Misc queries) | |||
How do I change the order of the data in a pie chart - excel 2003 | Charts and Charting in Excel | |||
Pivot Chart won't save order change of data | Excel Discussion (Misc queries) | |||
How do I change the order of the series in the Source Data? | Charts and Charting in Excel |