Paul,
I'm having a bit of difficulty; Here's how I adapted your code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim mySheet As String
mySheet = Application.WorksheetFunction.VLookup(.Sheets("Masterlist").Range("I2:I350").Value, .Sheets("Lookup").Range("B:C"), 2, False)
.Sheets("Masterlist").Range("A1:A144").EntireRow.Copy _
Destination:=.Sheets(mySheet).Range("A65536").End(xlUp).Offset(1, 0)
End Sub
I'm getting a compile error: Invalid or Unqualified reference at the (.Sheets( part of the code:
mySheet = Application.WorksheetFunction.VLookup(.Sheets("Masterlist").Range("I2:I350").Value, .Sheets("Lookup").Range("B:C"), 2, False)
I deleted the With and End With lines, because putting them in kept giving me a type mismatch (see first attempt code)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DstWkb As Workbook
Dim mySheet As String
Set DstWkb = "Required Reports by Region and Date.xls"
With DstWkb
mySheet = Application.WorksheetFunction.VLookup(.Sheets("Masterlist").Range("I2:I350").Value, .Sheets("Lookup").Range("B:C"), 2, False)
.Sheets("Masterlist").Range("A1:A144").EntireRow.Copy _
Destination:=.Sheets(mySheet).Range("A65536").End(xlUp).Offset(1, 0)
End With
End Sub
Also, on my dropdown, the options are Region 1, Region 2, etc. The worksheets are also named Region 1, Region 2, etc. Do I still need a lookup table?
Bookmarks