+ Reply to Thread
Results 1 to 11 of 11

need to retrieve names of different length

  1. #1
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    need to retrieve names of different length

    Evening All

    please see attached i have done the first column a simple trim left as that is always 4 numbers long but for the next column i need to put in the user name and there in lies the problem, names are not a set length so what would people suggest i have tried trim, but as i thought and you can see from attached example it doesn't work

    all help much appreciated
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: need to retrieve names of different length

    The easiest way would be to use Text to Columns, comma delimited. You can the keep/ditch whatever you need.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: need to retrieve names of different length

    thanks and thanks again was going a bit crazy looking at mid or search or find

    saved me a lot of time ta

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: need to retrieve names of different length

    Please Login or Register  to view this content.
    This function will work
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: need to retrieve names of different length

    popipipo,

    thanks for that but i pasted it in to test as nothing wrong with 2 ways of doing it but it failed says this see attached and the second one is when i click ok
    Attached Images Attached Images
    Last edited by jeffreybrown; 02-24-2018 at 03:16 PM. Reason: Please don't full quote!

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: need to retrieve names of different length

    It would be Easy with VBA.
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  7. #7
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: need to retrieve names of different length

    JLGWhiz,

    again thanks just one question how would i then get rid of the " and , which have been left in ?
    Last edited by jeffreybrown; 02-24-2018 at 03:16 PM. Reason: Please don't full quote!

  8. #8
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: need to retrieve names of different length

    Please Login or Register  to view this content.

    In the Netherlands we use a semicolon
    I think you uses the comma
    Attached Files Attached Files

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: need to retrieve names of different length

    another way
    Done with PowerQuery
    you can remove any column/columns in PQ Editor if you wish
    Attached Files Attached Files

  10. #10
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: need to retrieve names of different length

    Quote Originally Posted by murray83 View Post
    JLGWhiz,

    again thanks just one question how would i then get rid of the " and , which have been left in ?
    Please Login or Register  to view this content.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: need to retrieve names of different length

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] Loop through fields with identical names and retrieve the value
    By Enjoylifetothemax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2016, 07:06 AM
  2. Need help with formula to retrieve a video length
    By rebo77 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-20-2014, 02:38 AM
  3. Replies: 11
    Last Post: 10-21-2012, 01:40 AM
  4. How to retrieve names from the table? 2 criteria given
    By ABSTRAKTUS in forum Excel General
    Replies: 3
    Last Post: 05-10-2010, 01:15 PM
  5. Retrieve different names for same working hours
    By ElmerS in forum Excel General
    Replies: 4
    Last Post: 05-05-2010, 06:49 AM
  6. How do I retrieve the column names in a ADODB recordset from MS SQ
    By MChrist in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2005, 09:05 AM
  7. How do I increase the length of file names?
    By RJS in forum Excel General
    Replies: 1
    Last Post: 05-30-2005, 08:05 PM

Tags for this Thread

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