Sub insert_check()
Dim i As Integer
Dim Int_row As Integer
Dim Int_Row_Total As Integer
Int_row = 5
' 表示的就是在A列从第65536行(不包含第65536行)向上查找到的第一个有数据的单元格.
Int_Row_Total = Worksheets("月度汇总").Range("A65536").End(xlUp).Row
For i = 4 To Int_Row_Total
' 选择第一个要处理的行
Rows(Int_row).Select
' 插入行
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
' 在插入行中合并指定区域并填入文字
Range("B" & Int_row & ":AM" & Int_row).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = _
"记录考勤扣款:事假( )天,病假( )天,探亲假( )天,迟到( )次,早退( )次,旷工( )天,保胎假( )天。其他备注"
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
Range("A" & (Int_row - 1) & ":A" & Int_row).Select
Range("A" & Int_row).Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Int_row = Int_row + 2
Next
' ActiveWindow.ScrollRow = Int_row - 4
' ActiveWorkbook.Save
End Sub
2020-03-11考勤宏(公开)
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...