+ Reply to Thread
Results 1 to 12 of 12

display text depending on coice from drop down list

  1. #1
    Calle
    Guest

    display text depending on coice from drop down list

    I have made a drop down list in excel. When I click on an option I want the
    text to be added to another cell, so you in that way can choose several
    options from a dropdown list and have them all displayed in a cell just next
    to the list.



  2. #2
    Calle
    Guest

    RE: display text depending on coice from drop down list

    guess you can't do it... I think I overestimated excel

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    Never under-estimate Excel....

    If you add this sub to the sheet1 tab in the VBA editor

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
    If Target <> "" Then
    Cells(1, 2) = Cells(1, 2) & "," & Target
    End If

    End If
    End Sub

    this will add values into B1 from a drop down in A1
    Martin

  4. #4
    Ardus Petus
    Guest

    Re: display text depending on coice from drop down list

    This will require a Worksheet_Change event procedure in VBA (macro)

    --
    AP

    "Calle" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > guess you can't do it... I think I overestimated excel




  5. #5
    Calle
    Guest

    Re: display text depending on coice from drop down list

    Hi!
    It didn't work. I added this to the sheet1 tab in VBA editor and it did
    nothing. I am using a drop down meny useing the validation option.


    "mrice" skrev:

    >
    > Never under-estimate Excel....
    >
    > If you add this sub to the sheet1 tab in the VBA editor
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Target.Address = "$A$1" Then
    > If Target <> "" Then
    > Cells(1, 2) = Cells(1, 2) & "," & Target
    > End If
    >
    > End If
    > End Sub
    >
    > this will add values into B1 from a drop down in A1
    >
    >
    > --
    > mrice
    >
    > Research Scientist with many years of spreadsheet development experience
    > ------------------------------------------------------------------------
    > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    >
    >


  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    Working spreadsheet attached
    Attached Files Attached Files

  7. #7
    Calle
    Guest

    Re: display text depending on coice from drop down list

    Hi!
    The download link doesn't work

    "mrice" wrote:

    >
    > Working spreadsheet attached
    >
    >
    > +-------------------------------------------------------------------+
    > |Filename: Book1.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=4808 |
    > +-------------------------------------------------------------------+
    >
    > --
    > mrice
    >
    > Research Scientist with many years of spreadsheet development experience
    > ------------------------------------------------------------------------
    > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    >
    >


  8. #8
    Calle
    Guest

    Re: display text depending on coice from drop down list

    I got the script to work, I had to activate macros lol, thx m8!!!!!

    "mrice" wrote:

    >
    > Working spreadsheet attached
    >
    >
    > +-------------------------------------------------------------------+
    > |Filename: Book1.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=4808 |
    > +-------------------------------------------------------------------+
    >
    > --
    > mrice
    >
    > Research Scientist with many years of spreadsheet development experience
    > ------------------------------------------------------------------------
    > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    >
    >


  9. #9
    Calle
    Guest

    Re: display text depending on coice from drop down list

    I have a new question now:
    I want an option in my drop down list to clear the cell where the selected
    products from the drop down list are displayed. How do I do that?

    Calle

    "Calle" wrote:

    > I got the script to work, I had to activate macros lol, thx m8!!!!!
    >
    > "mrice" wrote:
    >
    > >
    > > Working spreadsheet attached
    > >
    > >
    > > +-------------------------------------------------------------------+
    > > |Filename: Book1.zip |
    > > |Download: http://www.excelforum.com/attachment.php?postid=4808 |
    > > +-------------------------------------------------------------------+
    > >
    > > --
    > > mrice
    > >
    > > Research Scientist with many years of spreadsheet development experience
    > > ------------------------------------------------------------------------
    > > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    > >
    > >


  10. #10
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    If you change the macro to this...

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
    If Target <> "" Then
    Cells(1, 2) = Cells(1, 2) & "," & Target
    End If
    End If

    If Target.Address = "$A$1" Then
    If Application.CountIf(Range(Cells(1, 3), Cells(6, 3)), Target) > 0 Then
    Range(Cells(1, 3), Cells(6, 3)).Find(Target, , xlValues, xlWhole).Clear
    End If
    End If
    End Sub

    The second segment searches for the value in a range (in this case C1:C6) and if it finds a match clears the cell.

  11. #11
    Calle
    Guest

    Re: display text depending on coice from drop down list

    Hi!
    The thing is that I am using a validation/list so the source for the list is
    on another worksheet. Will it still work?

    "mrice" skrev:

    >
    > If you change the macro to this...
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Target.Address = "$A$1" Then
    > If Target <> "" Then
    > Cells(1, 2) = Cells(1, 2) & "," & Target
    > End If
    > End If
    >
    > If Target.Address = "$A$1" Then
    > If Application.CountIf(Range(Cells(1, 3), Cells(6, 3)), Target) > 0
    > Then
    > Range(Cells(1, 3), Cells(6, 3)).Find(Target, , xlValues,
    > xlWhole).Clear
    > End If
    > End If
    > End Sub
    >
    > The second segment searches for the value in a range (in this case
    > C1:C6) and if it finds a match clears the cell.
    >
    >
    > --
    > mrice
    >
    > Research Scientist with many years of spreadsheet development experience
    > ------------------------------------------------------------------------
    > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    >
    >


  12. #12
    Calle
    Guest

    Re: display text depending on coice from drop down list

    I solved it. thx

    "Calle" skrev:

    > Hi!
    > The thing is that I am using a validation/list so the source for the list is
    > on another worksheet. Will it still work?
    >
    > "mrice" skrev:
    >
    > >
    > > If you change the macro to this...
    > >
    > > Private Sub Worksheet_Change(ByVal Target As Range)
    > > If Target.Address = "$A$1" Then
    > > If Target <> "" Then
    > > Cells(1, 2) = Cells(1, 2) & "," & Target
    > > End If
    > > End If
    > >
    > > If Target.Address = "$A$1" Then
    > > If Application.CountIf(Range(Cells(1, 3), Cells(6, 3)), Target) > 0
    > > Then
    > > Range(Cells(1, 3), Cells(6, 3)).Find(Target, , xlValues,
    > > xlWhole).Clear
    > > End If
    > > End If
    > > End Sub
    > >
    > > The second segment searches for the value in a range (in this case
    > > C1:C6) and if it finds a match clears the cell.
    > >
    > >
    > > --
    > > mrice
    > >
    > > Research Scientist with many years of spreadsheet development experience
    > > ------------------------------------------------------------------------
    > > mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
    > > View this thread: http://www.excelforum.com/showthread...hreadid=544782
    > >
    > >


+ 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