|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
'20160426 13:53 作者:coolall 北京
Sub run()
Row = Sheets(2).Range("a65536").End(xlUp).Row
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Name = Sheets(2).Cells(1, 2) & "-" & Trim(Str(Sheets.Count))
For i = 1 To Row
For j = 1 To 3
Cells(i, j) = Sheets(2).Cells(i, j)
Next j
Next i
Range("A1").Select
Call 宏2
End Sub
Sub 宏2()
Range("A1:B1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.8
.PatternTintAndShade = 0
End With
Range("A3:C3").Select
Selection.Font.Bold = True
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").EntireColumn.AutoFit
Row = Sheets(2).Range("a65536").End(xlUp).Row
Dim lineName As String
lineName = "A" & Trim(Str(Row)) & ":C" & Trim(Str(Row))
Range(lineName).Select
Selection.Font.Bold = True
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = -0.249946592608417
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ThemeColor = 5
.TintAndShade = -0.249946592608417
.Weight = xlMedium
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("A1").Select
End Sub
|
评分
-
1
查看全部评分
-
|