資源描述:
《在EXCEL中用宏生成兩行標(biāo)題的工資條的VBA代碼.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、Sub生成工資條()Cells.SelectRange("F1").ActivateSelection.Borders(xlDiagonalDown).LineStyle=xlNoneSelection.Borders(xlDiagonalUp).LineStyle=xlNoneSelection.Borders(xlEdgeLeft).LineStyle=xlNoneSelection.Borders(xlEdgeTop).LineStyle=xlNoneSelection.Borders(xlEdgeBottom).LineStyle=xlNoneSelection.B
2、orders(xlEdgeRight).LineStyle=xlNoneSelection.Borders(xlInsideVertical).LineStyle=xlNoneSelection.Borders(xlInsideHorizontal).LineStyle=xlNoneRows("3:3").SelectSelection.InsertShift:=xlDownSelection.InsertShift:=xlDownnum=600col=29num1=6DoWhilenum1<=numRange(Cells(num1,1),Cells(num1,col)).
3、SelectSelection.InsertShift:=xlDownSelection.InsertShift:=xlDownSelection.InsertShift:=xlDownnum1=num1+4LoopRange(Cells(1,1),Cells(2,col)).SelectApplication.CutCopyMode=FalseSelection.CopyRange("A3").SelectActiveSheet.Pastenum2=7DoWhilenum2<=numRange(Cells(1,1),Cells(2,col)).SelectApplicat
4、ion.CutCopyMode=FalseSelection.CopyCells(num2,1).SelectActiveSheet.Pastenum2=num2+4LoopRange(Cells(3,1),Cells(5,col)).SelectApplication.CutCopyMode=FalseSelection.Borders(xlDiagonalDown).LineStyle=xlNoneSelection.Borders(xlDiagonalUp).LineStyle=xlNoneWithSelection.Borders(xlEdgeLeft).LineS
5、tyle=xlDouble.Weight=xlThick.ColorIndex=xlAutomaticEndWithWithSelection.Borders(xlEdgeTop).LineStyle=xlDouble.Weight=xlThick.ColorIndex=xlAutomaticEndWithWithSelection.Borders(xlEdgeBottom).LineStyle=xlDouble.Weight=xlThick.ColorIndex=xlAutomaticEndWithWithSelection.Borders(xlEdgeRight).Li
6、neStyle=xlDouble.Weight=xlThick.ColorIndex=xlAutomaticEndWithWithSelection.Borders(xlInsideVertical).LineStyle=xlDash.Weight=xlThin.ColorIndex=xlAutomaticEndWithWithSelection.Borders(xlInsideHorizontal).LineStyle=xlDash.Weight=xlThin.ColorIndex=xlAutomaticEndWithSelection.CopyRange(Cells(7
7、,1),Cells(9,col)).SelectSelection.PasteSpecialPaste:=xlFormats,Operation:=xlNone,SkipBlanks:=False,Transpose:=Falsenum3=11DoWhilenum3<=numRange(Cells(num3,1),Cells(num3+2,col)).SelectSelection.PasteSpecialPaste:=xlFormats,Operation:=xlNone,SkipBlanks:=False,Tr