Consulting

Results 1 to 4 of 4

Thread: Solved: string concatenation

  1. #1

    Solved: string concatenation

    hi all,
    I have a column that i need to modify:

    i need to loop through all the values in the column and ensure that if the length of the string in each cell is not 28 then i need to pad it to the right with "x." if the length of the string is longer than 28 then i need to reduce it to be no longer than 28.

    any help will be much appreciated; thanks in advance

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Maybe Aaron's kb entry will help:

    http://vbaexpress.com/kb/getarticle.php?kb_id=946
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    that kb is definitely what i needed. thank you for your reply

  4. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    The spreadsheet formula

    =LEFT(A1&REPT("x",28), 28)

    should do what you want

Posting Permissions

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