私はExcel2010を使用しています。
「LOG」という名前のシートがあり、次のようなすべての従業員のログがあります。

今、私はという名前の別のシートを持っていますsheet1。
私が欲しいのは、従業員IDと月の入力を求め、その特定の月のその従業員のすべてのログを表示するマクロです。   
私はたくさんのことを試しましたが、できませんでした。
次のコードは、定数値で指定された列に結果を一覧表示RESULTS_COLUMNします。次のコードをワークシートに追加するだけです。基準を入力するには、 3つの名前付き範囲(EmployeeCode、StartDateおよび)も必要ですが、これらの別の方法でいつでもプロンプトを表示できます。EndDate
Sub DisplayRecords()
Const RESULTS_COLUMN As Long = 5
Dim strEmployeeCode As String
Dim dtStartDate As Date, dtEndDate As Date
Dim c As Range
    On Error GoTo ErrorTrap
    strEmployeeCode = [EmployeeCode]
    dtStartDate = [StartDate]
    dtEndDate = [EndDate]
    ' Clear the results column
    With Sheet1
        .Columns(RESULTS_COLUMN).ClearContents
        .Cells(1, RESULTS_COLUMN).Value = "Results"
        .Cells(1, RESULTS_COLUMN).Font.Bold = True
    End With
    For Each c In Sheet1.UsedRange.Columns(1).Cells
        If c.Value = strEmployeeCode And c.Offset(, 1) >= dtStartDate And c.Offset(, 1) <= dtEndDate Then
            ' Find the next available cell in results column
            Sheet1.Cells(Sheet1.Rows.Count, RESULTS_COLUMN).End(xlUp).Offset(1).Value = c.Offset(, 1).Value
        End If
    Next c
    Exit Sub
ErrorTrap:
    MsgBox "An error has occurred, please check input criteria", vbExclamation, ThisWorkbook.Name
End Sub