Hi.

Problem:

1. How can I copy a source of data that filters a specific data like dates?
Example column E has dates: 1/1/1999 , 2/1/2001, 3/11/2013
How to copy data with spefic data that has all dates of 3/11/2013 ?


Please see my code below:

Sub cmdSelectExcelFile_Click()
' Get customer workbook...
Dim customerBook As Workbook
Dim filter As String
Dim caption As String
Dim customerFilename As String
Dim customerWorkbook As Workbook
Dim targetWorkbook As Workbook

' make weak assumption that active workbook is the target
Set targetWorkbook = Application.ActiveWorkbook

' get the customer workbook
filter = "Text files (*.xlsx),*.xlsx"
caption = "Please Select an input file "

customerFilename = Application.GetOpenFilename(filter, , caption)
If customerFilename = "False" Then
    Exit Sub ' user cancelled
End If


Set customerWorkbook = Application.Workbooks.Open(customerFilename)

' assume range is A1 - C10 in sheet1
' copy data from customer to target workbook
Dim targetSheet As Worksheet
Set targetSheet = targetWorkbook.Worksheets(1)
Dim sourceSheet As Worksheet
Set sourceSheet = customerWorkbook.Worksheets(1)


Dim LastRow As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    

targetSheet.Range("A2:E" & LastRow).Value = sourceSheet.Range("A2:E" & LastRow).Value

' Close customer workbook
customerWorkbook.Close
End Sub
Thanks in advanced!