吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 5539|回复: 9
收起左侧

[其他转载] 【笔记】EXCEL(VBA)借助宏录制工资条

[复制链接]
bowangbuqi 发表于 2019-3-18 11:20
各位大佬大家好,直接来笔记:
   
    Dim i As Long
    For i = 2 To Range("A1").CurrentRegion.Rows.Count - 1
'
' 制作工资条 宏
'

'
    ActiveCell.Offset(2, 0).Rows("1:2").EntireRow.Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    ActiveCell.Offset(-2, 0).Rows("1:1").EntireRow.Select
    Selection.Copy
    ActiveCell.Offset(3, 0).Rows("1:1").EntireRow.Select
    ActiveSheet.Paste
    ActiveCell.Offset(-1, 0).Range("A1:G1").Select
    Application.CutCopyMode = False
    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.499984740745262
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ThemeColor = 5
        .TintAndShade = -0.499984740745262
        .Weight = xlThin
    End With
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    ActiveCell.Offset(1, 0).Range("A1").Select
   
    Next
   
End Sub
请大佬们多指正!!!!

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

lucicai 发表于 2019-7-27 07:18
据说过多使用选择语句会减慢速度哦
血色天空 发表于 2019-3-18 14:03
text888877 发表于 2019-3-23 20:35
iwzw 发表于 2019-6-18 16:28
学习了,谢谢!!!
pwrgod 发表于 2019-7-22 10:49
最近在了解vba,似乎就会用with...end with。
SuperCatCool 发表于 2019-7-22 18:36
小白,太多ActiveCell😏
czji 发表于 2019-8-17 21:17
无效的外部过程
平凡之家 发表于 2019-10-25 10:08
Range("A1").CurrentRegion.Rows.Count

获得("数据统计表")中A1单元格向右及向下连续有数据单元格的总行数
其间不能有空行或数据在横向或纵向有间断
m0716273254 发表于 2020-10-25 14:53
//

Private Sub Workbook_Open()
Application.ScreenUpdating = False '防止屏幕抖动,屏幕刷新禁止
If DateValue(Date) > DateValue(Sheets("主页").[iv65536]) Then
    p = InputBox("您的使用期限已经到期,请输入口令继续使用", , "")
    If p <> "rjs7374521" Then MsgBox "口令错误,请按确定退出!": ThisWorkbook.Close False
    Sheets("主页").[iv65536] = Date + 180
End If
Login.Show
Sheets("模板").Select
Application.ScreenUpdating = True '防止屏幕抖动,屏幕刷新禁止
End Sub

//

这是个登录窗口,想问下怎么修改能跳过它,或者自己注册有效口令
、、
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-26 01:53

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表