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.
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.
guess you can't do it... I think I overestimated excel
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
This will require a Worksheet_Change event procedure in VBA (macro)
--
AP
"Calle" <Calle@discussions.microsoft.com> a écrit dans le message de news:
57AFCE70-E302-4370-8913-F42637CC8F88@microsoft.com...
> guess you can't do it... I think I overestimated excel
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
>
>
Working spreadsheet attached
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
>
>
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
>
>
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
> >
> >
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.
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
>
>
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
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks