+ Reply to Thread
Results 1 to 3 of 3

Trim a files name to a specific amount of characters using vba.

  1. #1
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Trim a files name to a specific amount of characters using vba.

    Please Login or Register  to view this content.
    I marked the line where the name is changed. This line is taking a workbooks name and making it the worksheets name. However, the workbook is greater then 31 characters while a worksheet can only be 31 characters max.

    Can someone show me how you limit or trim a name down to a specified amount of characters?

    I know there is a trim and replace function but now how to use them in vba correctly.

    Thank you.
    Last edited by 111StepsAhead; 11-18-2011 at 11:54 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Trim a files name to a specific amount of characters using vba.

    Hi,

    Can you make use of the left function?

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: Trim a files name to a specific amount of characters using vba.

    Thank you sweep. That function worked nicely although I had to re-arrange how I used it.

    Please Login or Register  to view this content.

+ Reply to Thread

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