Results 1 to 4 of 4

Concatenate validation lists to same sheet.

Threaded View

leaning Concatenate validation lists... 10-05-2011, 11:29 AM
leaning Re: Concatenate validation... 10-05-2011, 01:43 PM
leaning Re: Concatenate validation... 10-05-2011, 02:16 PM
leaning Re: Concatenate validation... 10-05-2011, 03:36 PM
  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Talking Concatenate validation lists to same sheet.

    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
    Last edited by leaning; 10-06-2011 at 08:42 AM. Reason: Solved!!

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