- 19
- 0
- 约 10页
- 2016-11-27 发布于河南
- 举报
Execl表格宏程序
Sub Macro1()
Macro1 Macro
宏由 lenovo 录制,时间: 2012/9/27
快捷键: Ctrl+m
Sub Macro2()
Macro2 Macro
宏由 lenovo 录制,时间: 2012/9/27
快捷键: Ctrl+u
endrow = Range(B36).End(xlUp).Row
x = Cells(endrow, 2).Value
If Len(x) = 8 Then
If InStr(x, /) 0 Then
a = Left(x, InStr(x, /) - 1)
C = Right(x, InStr(x, /) + 1)
H = InStr(6, x, /) - 6
b = Mid(x, 6, H)
If a 2011 And a 2012 And a 2010 Then
a = 2012
End If
Else
If InStr(x, .) 0 Then
a = Left(x, InStr(x, .) - 1)
C = Right(x, InStr(x, .) + 1)
H = InStr(6, x, .) - 6
b = Mid(x, 6, H)
If a 2011 And a 2012 And a 2010 Then
a = 2012
End If
Else
If InStr(x, -) 0 Then
a = Left(x, InStr(x, -) - 1)
C = Right(x, InStr(x, -) + 1)
H = InStr(6, x, -) - 6
b = Mid(x, 6, H)
If a 2011 And a 2012 And a 2010 Then
a = 2012
End If
Else
b = Left(x, InStr(x, .) - 1)
C = Right(x, InStr(x, .) + 1)
Range(A2:M2).Select
y = ActiveCell.FormulaR1C1
y = Trim(y)
a = Mid(y, 1, 4)
If a 2011 And a 2012 And a 2010 Then
a = 2012
End If
End If
End If
End If
End If
k = 1 循环变量
MsgBox Worksheets.Count
Do While k = Worksheets.Count 工作表数量
Sheets(k).Select 逐个设置工作为当前工作表
Range(B6:B36).Select
Selection.NumberFormatLocal = @
If Application.WorksheetFunction.CountA(Rows(3)) = 0 Then
Rows(3).Delete
End If
Range(C3:J3).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range(A6:K37).Select
With Selection.Font
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont =
原创力文档

文档评论(0)