+ Reply to Thread
Results 1 to 7 of 7

Copy Specific Number of Characters From One Column to Another

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Copy Specific Number of Characters From One Column to Another

    Hi. I need to copy a specific number of characters from one column to another. The macro needs to delete the first 11 characters and then copy up to the next 80 characters stopping at the last complete word before the 80th character. Example spreadsheet attached. Thanks for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy Specific Number of Characters From One Column to Another

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copy Specific Number of Characters From One Column to Another

    Thanks, stnkynts. The macro works great to move 80 characters from the primary text to the name. But is there any way to stop the copy at the last full word before the 80th character? Example of why the copy needs take only whole words: The terms ASSESS and ASSESSMENT are in the CONDITION many times and management is concerned that if we move just the 80 characters, the name will end with the 1st 3 letters of the terms.

    See attached spreadsheet for a couple of examples where the name breaks mid-word. Thanks for the use of your brain.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy Specific Number of Characters From One Column to Another

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-13-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copy Specific Number of Characters From One Column to Another

    The new macro is moving, not copying, the text from the Primary Text column to the Name column and is moving more than 80 characters. See attached.

    The first macro did what it should except not breaking at the last full word before the 80th character.

    Thanks.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy Specific Number of Characters From One Column to Another

    It does not change or move the contents in column C when I do it. I don't know what you got going on there.
    I have amended to not go beyond 80 characters to complete a word and instead short 1 word if the total length is greater than 80:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-13-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copy Specific Number of Characters From One Column to Another

    The macro is now working perfectly. Thanks much stnkynts. Appreciate you sharing your knowledge!
    I'll mark this as Solved.

+ 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. Replies: 0
    Last Post: 12-02-2013, 02:50 PM
  2. [SOLVED] Limit LOOKUP to a specific number of characters
    By floydian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2013, 09:34 PM
  3. Replies: 4
    Last Post: 05-26-2013, 05:54 PM
  4. [SOLVED] Copy row by the number in a specific column
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2012, 01:57 PM
  5. Copy specific number of digits from column to column
    By cbridges in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2011, 04:30 PM

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