| 
    
     |  | 素人じゅうすけ さん 今晩わ 1項目の答え
 「8/31と9/31のデータを使って」 というのが良く分からないのですが、
 何月分ということでしたら下記の様にできますが?(私は棚卸し表を作る時、月名で指定しています。)
 
 Sub Test1()
 Dim R As Long
 Dim m As Integer  ''データ範囲の行数と月名
 R = UsedRange.Rows.Count
 m = Val(InputBox("抽出月"))
 For Each Rng In Range(Range("A2"), Cells(R, 1))
 If Month(Rng) = m Then
 Set CopyData = Range(Rng, Rng.Offset(, 3))
 CopyData.Copy _
 Destination:=Sheets(2).Range("A65536").End(xlUp).Offset(1, 0)
 End If
 Next
 End Sub
 --------------------------------------------------------
 2項目
 「数量の合計」とはG 列の「数量」以外にあるのですか?
 単にA列、C列、G列を取り出して、降順に並べ替えるのでしたら
 A列    C列    G列
 日付    人名    数量
 8月29日    A    100
 8月30日    C    1
 9月1日    D    1000
 9月3日    A    200
 9月5日    B    50
 9月29日    F    30
 9月30日    E    20
 10月1日    C    2
 10月2日    A    300
 の様なデータがあるとして、特定の人のデータでその行にある特定のセルをだけを取り出す。
 
 Sub Test2()
 Dim R As Long, R2 As Long '元データの行数と転記先の行番号
 Dim 人名 As String
 R = UsedRange.Rows.Count
 人名 = InputBox("抽出する人")
 For Each Rng In Range(Range("C2"), Cells(R, 3))
 If Rng.Value = 人名 Then
 With Sheets(2)
 R2 = .Range("A65536").End(xlUp).Offset(1, 0).Row
 .Cells(R2, 1) = 人名
 .Cells(R2, 2) = Rng.Offset(0, 4)
 .Cells(R2, 3) = Rng.Offset(0, -2)
 End With
 End If
 Next
 '降順に並べ替え
 With Sheets(2)
 .Activate
 .Range("A1").Select
 Selection.Sort Key1:=.Range("B2"), Order1:=xlDescending
 End With
 End Sub
 
 
 |  |