Results 1 to 10 of 10

Fix names with code

Threaded View

Xrull Fix names with code 02-16-2010, 11:19 PM
mdbct Re: Fix names with code 02-16-2010, 11:43 PM
Xrull Re: Fix names with code 02-17-2010, 12:08 AM
mdbct Re: Fix names with code 02-17-2010, 12:32 AM
mdbct Re: Fix names with code 02-17-2010, 12:45 AM
Xrull Re: Fix names with code 02-17-2010, 12:53 AM
DonkeyOte Re: Fix names with code 02-17-2010, 02:37 PM
DonkeyOte Re: Fix names with code 02-17-2010, 02:48 PM
mdbct Re: Fix names with code 02-17-2010, 04:31 PM
DonkeyOte Re: Fix names with code 02-17-2010, 04:39 PM
  1. #1
    Forum Contributor
    Join Date
    07-29-2008
    Location
    New York
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    145

    Fix names with code

    Good day,
    I have a spread sheet where I've got to change the names, eg The name Paul Dechristian with this formula:
    =TRIM(RIGHT(B2,LEN(B2)-FIND(" ",B2))&", "&LEFT(B2,FIND(" ",B2)-1))
    would be Dechristian, Paul.
    I tried using a code Donkeyote used to solved a problem on this forum:
    Sub Example()
    With Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
        .Value = Evaluate("IF(ISTEXT(" & .Address & "),PROPER(SUBSTITUTE(" & .Address & ","" "","", "",1)),REPT(" & .Address & ",1))")
    End With
    End Sub
    I changed it to this:
    Sub Example1()
    With Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
        .Value = Evaluate("IF(ISTEXT(" & .Address & "),TRIM(RIGHT(" & .Address & ",LEN(" & .Address & ")-FIND("" "",& .Address)),REPT(" & .Address & ",1))")
    End With
    End Sub
    but I get #VALUE! for all the cells.
    What am I doing wrong?
    Thanks,
    Xrull
    Last edited by Xrull; 02-17-2010 at 12:53 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1