|
楼主 |
发表于 2016-6-9 23:52
|
显示全部楼层
次标题的 问题终于解决了!代码有点长分享给大家!
Sub Stro()
' Inventory sorting program zim026 :Layout Variant:F192/MINGMING
'a = Range("a65536").End(xlDown).Row
'a = Range("a65536").End(xlUp).Row
Dim rowno As Integer
Dim day1 As String
Dim i As Long
Dim c As Long
rowno = [B65536].End(xlUp).Row
i = Range("a" & Cells.Rows.Count).End(3).Row - 1
If [K1] = "Aging days" Then
MsgBox "叫づ狡巨"
Exit Sub
Else
Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Sheets("1").Name = "list"
[l2] = "Aging days"
[L4] = "=TODAY()-K4"
Range("L4").Select
Range("L4:L" & rowno).Select
Selection.FillDown
' day1 = Format(Now(), "yyyy/mm/dd")
Selection.NumberFormatLocal = "0"
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Rows("3:3").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.Delete Shift:=xlUp
End If
a = Range("a65536").End(xlUp).Row
' c = Range("a1").End(xlToRight).Column
Rows("1:1").Select
Selection.AutoFilter
Range("D1").Select
Selection.AutoFilter Field:=4, Criteria1:="=9", _
Operator:=xlOr, Criteria2:="=C"
i = Range("A" & Cells.Rows.Count).End(3).Row - 1
If i > 1 Then
' Range("A1" & ":zy" & a).Copy
' Range("A1" & ":ZY" & a).Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
' Cells.Select
' Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "珇"
ActiveSheet.Paste
Else
MsgBox "矗ボ厨礚珇腹"
End If
Sheets("list").Select
Selection.AutoFilter
Range("D1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="S"
i = Range("A" & Cells.Rows.Count).End(3).Row - 1
If i > 1 Then
'Range("A1" & ":ZY" & a).Copy
'Range("A1" & ":ZY" & a).Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "Θ珇"
ActiveSheet.Paste
Else
MsgBox "矗ボ厨Θ珇腹"
End If
Sheets("list").Select
Range("D1").Select
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="=L"
i = Range("A" & Cells.Rows.Count).End(3).Row - 1
If i > 1 Then
'Range("A1" & ":ZY" & a).Copy
'Range("A1" & ":ZY" & a).Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = "Panel LCD "
ActiveSheet.Paste
Else
MsgBox "矗ボ厨Panel LCD 腹"
End If
Sheets("list").Select
Range("D1").Select
Selection.AutoFilter
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:=Array("E" _
, "F", "G", "I", "J", "M", "N", "Q", "R", "W", "X", "Z", "D"), Operator:=xlFilterValues
i = Range("A" & Cells.Rows.Count).End(3).Row - 1
If i > 1 Then
' Range("A1" & ":ZY" & a).Copy
' Range("A1" & ":ZY" & a).Select
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = " "
ActiveSheet.Paste
Sheets("list").Select
Range("D1").Select
Application.CutCopyMode = False
Selection.AutoFilter
MsgBox "磅︽OK"
Else
MsgBox "矗ボ厨 腹"
End If
End Sub
|
|