Hello.
I have used this code before to combine two validation lists.
Hopefully, this will be easy. Now, instead of putting the combined list on a separate sheet, I'd like it in the Z column of the "Lists" sheet (the sheet the separate lists are on.). And instead of a button, some kind of way where if I add/remove entries to either of the separate lists ("VendCity" and "CustComb"), the combined list ("MyBigList") automatically grows and shrinks so it is always accurate.
Here's the code:
Private Sub CommandButton2_Click()
Dim wsBigList As Worksheet, ws As Worksheet
Dim wsBigListFound As Boolean: wsBigListFound = False
For Each ws In ActiveWorkbook.Sheets
If ws.Name = "Big Combined List" Then
Set wsBigList = ws
wsBigListFound = True
Exit For
End If
Next ws
If wsBigListFound = False Then
Set wsBigList = Sheets.Add(after:=Sheets(Sheets.Count))
wsBigList.Name = "Big Combined List"
wsBigList.Visible = xlSheetHidden
End If
With wsBigList
.Columns(1).Clear ' Clear MyBigList ready for copy/paste
Sheets("Lists").Range("Plant").Copy .Range("A1") 'Copy 1st dynamic range and paste to A1 of Sheet4
Sheets("Lists").Range("Shop").Copy .Cells(.Rows.Count, "A").End(xlUp)(2, 1) 'Copy 2nd dynamic range and paste to 1 below last used row of Sheet4
.Range("A1", .Cells(.Rows.Count, "A").End(xlUp)).Name = "MyBigList" 'Name the new dynamic range
End With
End Sub
Any ideas?
Respectfully,
Lost
Bookmarks