|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub Macro1()
'
' Macro1 Macro
' 宏由 administered 录制,时间: 2020/03/15
'
'
Rows("3:3").Select
Selection.Insert Shift:=xlShiftDown
Range("F4").Select
With ActiveSheet.Sort
With .SortFields
.Clear
.Add Key:=Range("F5:F82"), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:=""
.Add Key:=Range("D5:D82"), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:=""
.Add Key:=Range("B5:B82"), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:=""
End With
.Header = xlYes
.Orientation = xlSortColumns
.MatchCase = False
.SortMethod = xlPinYin
.SetRange Rng:=Range("A4:I82")
.Apply
End With
Range("A4:I82").Select
Selection.Activate
With Selection.Borders(xlEdgeLeft)
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Borders(xlEdgeTop)
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Borders(xlEdgeBottom)
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Borders(xlEdgeRight)
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Borders(xlInsideVertical)
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Borders(xlInsideHorizontal)
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Borders(xlEdgeLeft).ColorIndex = xlColorIndexAutomatic
Selection.Borders(xlEdgeTop).ColorIndex = xlColorIndexAutomatic
Selection.Borders(xlEdgeBottom).ColorIndex = xlColorIndexAutomatic
Selection.Borders(xlEdgeRight).ColorIndex = xlColorIndexAutomatic
Selection.Borders(xlInsideVertical).ColorIndex = xlColorIndexAutomatic
Selection.Borders(xlInsideHorizontal).ColorIndex = xlColorIndexAutomatic
Columns("D:D").Select
Range("D3").Activate
With Selection
.VerticalAlignment = xlVAlignBottom
.AddIndent = False
.IndentLevel = 0
.Orientation = 0
.WrapText = True
.ShrinkToFit = False
End With
Columns("E:E").Select
Range("E3").Activate
With Selection
.VerticalAlignment = xlVAlignBottom
.AddIndent = False
.IndentLevel = 0
.Orientation = 0
.WrapText = True
.ShrinkToFit = False
End With
Columns("G:G").Select
Range("G3").Activate
With Selection
.VerticalAlignment = xlVAlignBottom
.AddIndent = False
.IndentLevel = 0
.Orientation = 0
.WrapText = True
.ShrinkToFit = False
End With
Columns("H:H").Select
Range("H3").Activate
With Selection
.VerticalAlignment = xlVAlignBottom
.AddIndent = False
.IndentLevel = 0
.Orientation = 0
.WrapText = True
.ShrinkToFit = False
End With
Range("A5").Select
Selection.Formula = "1"
Range("A6").Select
Selection.Formula = "2"
Range("A5:A6").Select
Selection.AutoFill Destination:=Range("A5:A82"), Type:=xlFillDefault
Range("A5:A82").Select
ActiveWindow.ScrollRow = 1
With Columns("G:G")
.EntireColumn.Hidden = False
.ColumnWidth = 11.333333
End With
End Sub
|
|