range("a"&i)
cells(i,j)
Sub Sheet5_按鈕1_單擊()
Rows("3:3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
nowrow = 6
For i = 2 To Sheets("入庫明細").UsedRange.Rows.Count
findaaa = 0
For j = 6 To nowrow
If Sheets("月報").Range("d" & j) = Sheets("入庫明細").Range("c" & i) & "/" & Sheets("入庫明細").Range("g" & i) Then
findaaa = 1
j = 65536
End If
Next j
If findaaa = 0 Then
Sheets("月報").Range("d" & nowrow) = Sheets("入庫明細").Range("c" & i) & "/" & Sheets("入庫明細").Range("g" & i)
nowrow = nowrow + 1
End If
Next i
MsgBox nowrow
Range("D6:D" & nowrow - 1).Select
Selection.Sort Key1:=Range("D6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin, DataOption1:=xlSortNormal
End Sub