+ Reply to Thread
Results 1 to 7 of 7

Character Fill Cell

  1. #1
    Registered User
    Join Date
    08-25-2006
    Posts
    1

    Character Fill Cell

    I believe there is a formula to fill a cell with a chosen character. For example, say I want the cell to be filled with the character "-"
    I know there is a function REPT which will allow for a specific number of repetitions. However, I'm looking for a formula that will automatically fill the cell with this character - no matter how wide the cell may be.
    Can anyone help?

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    I used this formula

    =REPT("-",CELL("width",E7))

    and change the font to MS Outlook which resulted in the cell being filled with

    [][][][][][][][] <----- what looks like little boxes not the actual brackets.

    Any time I changed the width of the column and recalced the sheet the cell was filled with the boxes.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by eteaneck
    I believe there is a formula to fill a cell with a chosen character. For example, say I want the cell to be filled with the character "-"
    I know there is a function REPT which will allow for a specific number of repetitions. However, I'm looking for a formula that will automatically fill the cell with this character - no matter how wide the cell may be.
    Can anyone help?
    Hi eteaneck,

    Here's another way, instead of a formula, you could format the cell - Custom format

    @*-
    or
    *-@

    this will fill the cell with the character irrespective of the width of the cell

    oldchippy

  4. #4
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Swweeeeeeeeeeeeet!! Thanks Chippy!

  5. #5
    Registered User
    Join Date
    08-31-2006
    Posts
    2
    Hi!
    Format works well with only one char, but what if I want to insert some text and then fill out the remainder?
    eg. [Cut here-----------------------------------------------------]
    Then Format is useless.
    Any ideas?

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by Ryden
    Hi!
    Format works well with only one char, but what if I want to insert some text and then fill out the remainder?
    eg. [Cut here-----------------------------------------------------]
    Then Format is useless.
    Any ideas?
    Hi Ryden,

    Type [Cut here in the cell, then format the cell to

    @*-]

    This should do what you want

    oldchippy

  7. #7
    Registered User
    Join Date
    08-31-2006
    Posts
    2

    Thanks

    Most Excellent!
    Exactly what I wanted!
    Now I just have to fire up VS 2003 and do it programmatically.
    Thanks! /Anders

+ 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