+ Reply to Thread
Results 1 to 5 of 5

Change a cell based on input

  1. #1
    Registered User
    Join Date
    01-06-2010
    Location
    Stockton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Change a cell based on input

    Hi
    Really simple one for you techie people,
    when i enter a number into a cell, I want the cell to be reformated and its content changed.
    ie when i enter the number 2 in a cell i want the backgroound color to change and the number to be replaced with a text word.
    Can anyone tell me what code i need to ender to make this work?

    thanks in advance.

    G.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Change a cell based on input

    I suspect that what you *really* want may be a bit more complicated.

    Can you describe all possible numbers that may be entered.
    (from 1 to 10 is easy....from 1 to 100,000 is more complex)
    Also describe the format you want the text to have.
    ("One Hundred Two" versus "One Hundred and Two")
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-06-2010
    Location
    Stockton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Change a cell based on input

    Hi ron,
    no its really simple, on a large rota i enter 1 for work days, 2 for days off and 3 for holidays

    I can see at a glance what is going on, but the staff dont get it, too confusing...! so while its simple for me when im working the rota out, id like it to replace "2" with "Off" and color the background yellow...

    then they may turn up for work on the correct days..

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Change a cell based on input

    Try using conditional formatting....

    Example for cells B2:Z20

    Please Login or Register  to view this content.
    After that...When you enter a number between 1 and 3, inclusive, the
    cells display Work, OFF, or Holiday (without changing the cell contents)

    Is that something you can work with?

  5. #5
    Registered User
    Join Date
    01-06-2010
    Location
    Stockton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Change a cell based on input

    Hi
    I cant get this to work, the months on the rota are in seperate blocks with individual headers so selecting a range across the whole sheet includes lots of headers wchich have the days of the month in, 1..31 etc, im getting random results, some months the number 1 is changing as expected but not in others...

    I was hoping to achieve this with an after change or update type statement in vb, is that easy to do?


    thanks
    F5

+ 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