Apr 25 2023 06:38 PM
I have a item list in sheet 1 of work book, A2 to A47 I would be adding more items to this list. On sheet 2 I have 7 columns A to G which I will have A (name), B (surname), C (mobile), D (email), E (Country), F (industry), G (status). I would like to have a dropdown list in F to add multiple in a cell as I add information in row what is VBA code i can use to have multiple item entries in F2
Apr 25 2023 09:56 PM
Apr 26 2023 01:06 AM
You can use VBA code to create a dropdown list with multiple selections in a cell. Here is an example of VBA code that you can use to achieve this:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Address = "$F$2" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
This code will allow you to select multiple items from the dropdown list in cell F2 by separating them with a comma. You can modify the code to fit your specific needs.
After also creating a dropdown menu, you can use this code to select multiple items from the dropdown list in cell F2 by separating them with a comma. You can adapt the code to your specific needs.
Attached is an example file where you can test the function.
Hope it will help you in your project!
Apr 26 2023 03:47 AM
Hi @NikolinoDE
Thank you so much for your assistance...
I am not conversant with what code is and don't have the understanding ...
I was successful with the testing though when I named sheets did not work...
After inserting rows above to insert picture and freeze panes for "Headings" Sheet 1 is renamed to members ... data entry rows start at G9 and sheet (1) name is Members ....
So in essence Sheet 1 "Members" entry of dropdown would be from G9 to G108
Sheet 2 is renamed to Industry...
Also as multiple entries will be in G9 is there a way to view as a window if possible please
Regards,
@Charlie_The_Connetcor
Apr 26 2023 04:28 AM
Apr 26 2023 05:25 AM
In order to accomplish this, at least basic knowledge of VBA is required.
Here is another example,
...but in order to get a more precise solution, I recommend that you insert a file (without sensitive data) and explain step by step what exactly you want to do.
In addition, I recommend the Excel version, operating system, storage medium, etc. to inform.
All of this would make things a whole lot easier for everyone.
Apr 26 2023 01:33 PM
Apr 26 2023 05:40 PM
Apr 26 2023 05:50 PM
Apr 26 2023 11:50 PM
Apr 27 2023 12:10 AM - edited Apr 27 2023 12:11 AM
upload file to forum。
please refer to above video。
Apr 27 2023 12:20 AM
Apr 27 2023 12:25 AM
Apr 27 2023 12:30 AM
Yes, I have search for solution and only way I could do that is via google drive ...
Also video you sent is in Chinese and I could not figure out instructions ... those functions are not on PC ...
Apr 28 2023 04:00 AM
Apr 28 2023 02:43 PM
Apr 28 2023 02:51 PM
Apr 28 2023 03:05 PM
I'm actually doing any code, have no clue what it means and don't have the accumen, hence me seeking help to do correctly ...
Thank you for you patience and assistance
Apr 28 2023 03:09 PM - edited Mar 28 2024 04:27 PM
I have uploaded the sample file for your reference.
As I have no windows PC on hand,I can not debug VBA for your excel workbook.
If any question you meet during development,we can discuss here.
Apr 28 2023 03:17 PM
I could not make head or tail from the file you sent...
Thank you for your assistance ...
I will have to find someone local who can do this for me...