+ Reply to Thread
Results 1 to 3 of 3

Switching last, first name order

  1. #1
    Forum Contributor
    Join Date
    10-12-2018
    Location
    Leesburg, FL
    MS-Off Ver
    2013
    Posts
    113

    Switching last, first name order

    Hello - I wanted to create a macro that would convert lastname, firstname to firstname lastname. I have created a button that will parse the cells that I have selected in the sheet to be converted. I want to try and do this myself, but I have a question regarding the FIND function. Apparently, this function doesn't work in VBA. You need to use the .Find function instead, but this doesn't appear to do what the FIND function does. Below is my code so far...
    Please Login or Register  to view this content.
    The Find function gives a compile error. I need the Find function to find a substring within a given string then return its location (index). This is my first time posting so I hope I am explaining this clearly.
    Thanks,
    Brian
    Last edited by Leith Ross; 10-12-2018 at 01:59 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Switching last, first name order

    Have a look at this link
    https://www.excelforum.com/excel-pro...he-column.html
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Contributor
    Join Date
    10-12-2018
    Location
    Leesburg, FL
    MS-Off Ver
    2013
    Posts
    113

    Re: Switching last, first name order

    Thanks for the reply. I actually figured it out by using the InStr() function. This was the piece I was missing. So instead of using Find(s, k.Value), I use InStr(1, k.Value, s).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Avoid Switching Sheets, Reference Sheet Without Switching Instead.
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2017, 06:59 PM
  2. Replies: 4
    Last Post: 12-02-2014, 03:46 AM
  3. Replies: 1
    Last Post: 12-01-2014, 03:01 PM
  4. [SOLVED] Order Form to Summarise Order on another sheet with a Submit Order Button
    By KazzICC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2014, 03:25 AM
  5. Considering switching to a Mac
    By GlenSydney in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 05-09-2014, 09:03 AM
  6. switching last name/first name
    By charlie11k in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2009, 11:13 AM
  7. switching order of numbers
    By oinkboink in forum Excel General
    Replies: 4
    Last Post: 06-11-2008, 02:36 AM

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