+ Reply to Thread
Results 1 to 3 of 3

Thread: RPad Function Help

  1. #1
    Registered User
    Join Date
    10-18-2011
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question RPad Function Help

    I've been trying to pad cells in Excel and found a formula that seemed to work with a program called litLIB that popped up from googling this.

    the formula was =RPAD("string",padlength,"padcharacter")

    I have a spreadsheet with about 20 columns and I was hoping this formula could cross over into another worksheet

    I tried something like =RPad(worksheetA.xls!$A$1,25," ") and that seems to be fine for one cell, but I cannot seem to copy it down the column as in =RPad(test.xls!$A$2, 25," ") =RPad(test.xls!$A$3,25," ") etc... automatically, instead I am stuck changing it for each one and I have about 3,000 rows.

    Can I create a range from the first worksheet and place it in this formula? I've tried defining a range but I can't figure out exactly how to place it in the formula to get it to work.

    Thanks for the help

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    MSO2007 on WinXP/MSO2000 on Win7/winXP
    Posts
    2,180

    Re: RPad Function Help

    In: =RPad(worksheetA.xls!$A$1,25," ")
    note that the $'s are anchors. The one preceding the A anchors the column so that when dragging the formula to the right across columns, The formula maintains a fix on column A. The same is true of the one preceding the 1, it anchors/fixes the row at #1. So, remove the $/anchor from the row number:
    =RPad(worksheetA.xls!$A1,25," ")
    ---
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-18-2011
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: RPad Function Help

    Thank you, that worked nicely

    A follow-up q, when I pad a cell and then save it as a .txt(tab delimited) file and then open it up in notepad, it's adding tabs in between the cells. Any idea how I can not have this happen? Would be a great help.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0