+ Reply to Thread
Results 1 to 10 of 10

Condition Cell

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Condition Cell

    How can I make it so that if a user in enters t or T in a specific cell the cell automatically shows "TRUE" and if they enter f or F the cell shows "FALSE"
    I need this condition on cells in range G11:G24

    thank you for your time and help.

  2. #2
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373
    Hi

    It's easier if you restrict the user input to True and False with a dropdown using a list in Data>Validation.

    If for some reason you really want to have the user input t or T and automatically change the value of the cell to True, you have to use vba. Use the worksheet Change Event.

    HTH
    lecxe

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    I would like to use the change event, but I don't know how write it.

    I have this change event I have been using but don't know how to edit it to fit my needs.

    Would you know how to change it?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373
    Hi again

    You can complement VBA Noob's code with Data Validation in the worksheet to ensure that the user is only allowed to enter the letters f and t.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Or just tweak it slightly

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    code works, but I am unable to delete the cell contents. How do I fix this??

  8. #8
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    I think I got It I changed the undo part to this

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    The final product

    Please Login or Register  to view this content.
    Also, I used the validation msg box option to inform what to write
    Thank you both very much for your help

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad to hear

    VBA Noob

+ 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