2025年11月5日
摘要: Sub 遍历文件1() Path = ThisWorkbook.Path & "\文件夹的创建与遍历" '注意路径最后要带 "" ss = Dir(Path) '遍历路径下所有文件,会排除隐藏属性的文件 Do Range("a1").Offset(n, 0) = ss ss = Dir n = n 阅读全文
posted @ 2025-11-05 23:57 青竹小轩 阅读(0) 评论(0) 推荐(0)
摘要: 方法一:条件格式 'Private Sub Worksheet_SelectionChange(ByVal Target As Range) ' If Target.Count > 1 Then Exit Sub ' Sheet1.Cells.FormatConditions.Delete ' ' 阅读全文
posted @ 2025-11-05 23:57 青竹小轩 阅读(2) 评论(0) 推荐(0)
摘要: 'Public path As String Sub adodb_test1() '声明并初始化对象 Dim cnn As New ADODB.Connection Dim rs As New ADODB.Recordset Rem 一、 建立连接 Rem 连接access数据库: 'With cn 阅读全文
posted @ 2025-11-05 23:46 青竹小轩 阅读(4) 评论(0) 推荐(0)
摘要: 'FileFilter String 文件类型过滤器 "所有文件 (.), ." 'FilterIndex Integer 默认使用的过滤器索引 1 'Title String 对话框标题 "打开" 'ButtonText String 按钮显示文字(仅Mac) - 'MultiSelect Boo 阅读全文
posted @ 2025-11-05 23:46 青竹小轩 阅读(2) 评论(0) 推荐(0)
摘要: Declare PtrSafe Function MessageBoxTimeout Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As Str 阅读全文
posted @ 2025-11-05 23:44 青竹小轩 阅读(2) 评论(0) 推荐(0)
摘要: Sub 系统时间() Debug.Print Date '2025/11/1 Debug.Print Time '17:44:30 Debug.Print Now '2025/11/1 17:44:30 Debug.Print Timer '63870.97,一天86400秒 Debug.Print 阅读全文
posted @ 2025-11-05 23:43 青竹小轩 阅读(3) 评论(0) 推荐(0)
摘要: '数组声明方式 Sub 静态数组() 'VBA数组默认从0开始索引,除非明确指定下限,如例子明确了下限是1开始到7结束 Dim days(1 To 7) As String '注意确定范围,如这里1 to 7 days(1) = "星期一" days(2) = "星期二" MsgBox days(1 阅读全文
posted @ 2025-11-05 23:41 青竹小轩 阅读(2) 评论(0) 推荐(0)
摘要: Sub 工作表密码破解() activesheet.Protect DrawingObjects:=True, CONTENTS:=True, AllowFiltering:=True activesheet.Protect DrawingObjects:=False, CONTENTS:=True 阅读全文
posted @ 2025-11-05 23:41 青竹小轩 阅读(2) 评论(0) 推荐(0)
摘要: customui 用户自定义功能区层次关系-选项卡-组-控件按钮一 准备工作 :1、ribbon xml editor 安装-编写xml并写入工作簿的程序二 步骤:1、xml代码撰写并验证(注意大小写,书写规则,在关闭工作簿但打开excel程序的状态下查看验证效果)2、查看回调(右键-查看回调-vb 阅读全文
posted @ 2025-11-05 23:38 青竹小轩 阅读(2) 评论(0) 推荐(0)