+ Reply to Thread
Results 1 to 7 of 7

Thread: If cell a1=x, then cell b1=y

  1. #1
    Registered User
    Join Date
    01-06-2011
    Location
    Leominster, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    If cell a1=x, then cell b1=y

    I am working on a spreadsheet that requires cell I4 to be a drop down selection. What I want is to have cell I6 display different things depending on the selection made in cell I4.

    Cell I4 menus :
    Please select (I want I6 to be blank)
    AA (I want I6 to display title "AA Name:") then J6 to display a drop down list of names IF possible, if not they can type it in)
    EWR (I want I6 to display title "Date submitted:")
    BP (I want I6 to display title "BP Approved by rep on:")

    Can someone help me with this?
    Last edited by kkt; 01-06-2011 at 03:07 PM. Reason: Solved

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: If cell a1=x, then cell b1=y

    Try:

    =LOOKUP(I4,{"AA","BP","EWR","Please Select"},{"AA Name:","BP Approved by rep on:","Date Submitted:",""})
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: If cell a1=x, then cell b1=y

    Also, if you want a list for when I4 is AA... then create the list of names on the side somewhere to include, name it via Insert|Name|Define and call it something like List. Then apply Data Validation to I6 and select List and insert formula in the Source Field: =IF(I4="AA",List)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  4. #4
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,590

    Re: If cell a1=x, then cell b1=y

    Try this workbook

    Make three Named lists.

    In this example := Code, CodeLookup, and Names
    All are dynamic in this sample, add to or delete from them if required.
    Just remember := Don't leave blanks within the lists

    In the Sheet Module Change Event
    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Address = "$I$4" Then
            With Range("J6")
                .Validation.Delete
                .Value = ""
            End With
            If Target = "AA" Then
                With Range("J6").Validation
                    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
                         Operator:=xlBetween, Formula1:="=names"
                    .IgnoreBlank = True
                    .InCellDropdown = True
                    .InputTitle = ""
                    .ErrorTitle = ""
                    .InputMessage = ""
                    .ErrorMessage = ""
                    .ShowInput = True
                    .ShowError = True
                End With
            End If
        End If
    End Sub
    Fill the warnings/titles to suit your needs

    Hope this helps.

    [EDIT]
    If you go NVBCs' way, remember to uncheck the error alerts otherwise you will not be able to put anything in J6 that is not on the list.
    Attached Files Attached Files
    Last edited by Marcol; 01-06-2011 at 02:11 PM.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  5. #5
    Registered User
    Join Date
    01-06-2011
    Location
    Leominster, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: If cell a1=x, then cell b1=y

    Thanks! Everything worked wonderfully! You guys rock

  6. #6
    Registered User
    Join Date
    05-25-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: If cell a1=x, then cell b1=y

    OK thanks Marcol for help... and sorry for my mistake
    Attached Files Attached Files
    Last edited by Arshmaan; 01-19-2012 at 05:57 AM.

  7. #7
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,590

    Re: If cell a1=x, then cell b1=y

    Hi Arshmaan

    Read this Forum Rules before the moderators get you...

    Forum Rules
    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
    Also read the rules about putting your code in tags.

    If you can Edit/Delete your post, do so, if not you'll need to ask a moderator to help you.

    Cheers

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