+ Reply to Thread
Results 1 to 9 of 9

Cell based on formula and allow user input?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Question Cell based on formula and allow user input?

    Cell A5 has a Yes_No pull-down list for data validation.

    In cell B5, I want to display the value 0.002 only if A5 is "Yes"

    If A5 is "No", I want the user to be able to enter a number into the B5 cell without destroying the formula.

    Is this possible? Thanks.

    Excel 2000
    Last edited by proepert; 01-16-2010 at 05:01 PM. Reason: Change title, oops.

  2. #2
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: Cell based on formula and allow user input?

    Thank you.

    Can you tell me how to do it using VBA? I'm a rookie but brave and willing to learn.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Cell based on formula and allow user input?

    Put this in the relevant sheet module:
    Private Sub Worksheet_Change(ByVal Target As Range)
        With Target
            If .Address = "$A$5" Then
                If LCase(.Value) = "yes" Then
                    Range("B5").Value = 0.002
                Else
                    Range("B5").Formula = "=A1" ' replace with the correct formula
                End If
            End If
        End With
    End Sub
    Adding Code to a Sheet module
    1. Copy the code from the post
    2. Right-click on the tab for the relevant sheet and select View Code. This opens the Visual Basic Editor (VBE) and shows the object module for the selected worksheet.
    3. Paste the code in the window
    4. Press Alt+Q to close the VBE and return to Excel
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: Cell based on formula and allow user input?

    Thank you very much.

    In addition, can the B5 cell be locked while A5 is "yes", so the user can't edit the .002 value, and be unlocked otherwise?

  5. #5
    Registered User
    Join Date
    06-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Cell based on formula and allow user input?

    Hello,

    I am new to this forum and have been looking at past threads to see if my issue can be resolved but with no luck.

    I am trying to allow the user to input a value if a specific cell says "INSERT WALL" but if it does not, then there is an index to another worksheet that displays the value.

    It seems like there is a way to do this through VBA, but I am unfamiliar with VBA, so some help would be great. Here is the basic set up:

    Cell D3 is a drop down list that says "INPUT WALL" or other various things.
    IF D3 = "INPUT WALL" I want the user to be able to input a value into cell E3
    else, I want E3 to be indexed from another worksheet with matching, (which I know how to do)

    Thanks!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Cell based on formula and allow user input?

    Hi brickwall015 and welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    06-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Cell based on formula and allow user input?

    well can some one give me the link where I start a new thread??

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Cell based on formula and allow user input?

    click on FORUM at the top of the screen, select the appropriate forum (maybe General?) and then start a new thread there

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Cell based on formula and allow user input?

    No, it's not possible (without VBA).

    But you can use a third cell: =if(a5 = "yes", 0.002, b5)

+ 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