Hello,
I would like to start off by saying I am very new to Macros/VBA and I need some help. What I need to do is set up two fields that will allow a user to change the search/sort details. I have a rather large amount of data saved on sheet 2 and what I want to do is, if the branch (D2) and Date (E2) match I want to copy an email address (G2 to sheet 1 starting in cell A2 and so forth for each time Branch and Date match. I have been using a code however it will not allow me to change the Branch and date unless you change it in the code. I would really appreciate any help you could offer. Below is the code I have been using.


Sub Macro2()
'
' Macro2 Macro
'

'
Sheets("Report").Select
Cells.Select
ActiveSheet.Range("$A$1:$AL$59715").AutoFilter Field:=3, Criteria1:="2503"
ActiveSheet.Range("$A$1:$AL$59715").AutoFilter Field:=18, Operator:= _
xlFilterValues, Criteria2:=Array(2, "3/18/2015")
Range("L15939:L22734").Select
Selection.Copy
Sheets("Main").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Dim z As Long
z = Cells(Rows.Count, 1).End(xlUp).Row
Cells(1, 1).ClearContents
For a = 2 To z
Cells(1, 1) = Cells(1, 1) & "; " & Cells(a, 1)
Next a
Cells(1, 1) = Mid(Cells(1, 1), 2, 100000)
MsgBox "complete"
End Sub