VBA零散记录
VBA学习记录,报错处理方法
不吃虾米虾皮虾酱
GitHub&掘金:festinalente|CSDN主要记录零散内容
展开
-
VBA|使用vba代码批量查找并替换vba代码
Sub CommandButton1_Click() On Error Resume Next Dim fd As FileDialog, it Dim fso As Object Dim file_name As String Dim strFolder As String Dim wb As Workbook Dim i As Inte...原创 2020-07-02 21:17:26 · 2553 阅读 · 0 评论 -
VBA|使用vba代码批量添加vba代码
Sub CommandButton1_Click() On Error Resume Next Dim fd As FileDialog, it Dim fso As Object Dim file_name As String Dim new_dir As String Dim strFolder As String Dim wb As ...原创 2020-07-02 21:18:38 · 897 阅读 · 0 评论 -
VBA|使用vba代码为多个excel批量导入模块
Sub button_Click() On Error Resume Next Dim fd As FileDialog, it Dim fso As Object Dim file_name As String Dim new_dir As String Dim strFolder As String Dim wb As Workbook...原创 2020-07-02 21:17:42 · 2843 阅读 · 0 评论 -
VBA|每次打开excel自动更新vba代码中的模块
vba嵌入的特殊功能模块有时会做更改,为了节省时间,可以在thisworkbook中添加如下代码,实现每次打开excel文件,自动导入最新版本的模块。Private Sub Workbook_Open() Dim s As String Dim arr Dim brr Dim i As Integer On Error Resume Next ...原创 2020-07-02 21:17:54 · 2862 阅读 · 0 评论 -
VBA|利用字符串拼接存储到字典中,在使用split分割实现数组数据存储字典
Dim d As ObjectSet d = CreateObject("scripting.dictionary")Dim r as IntegerDim arrr = Cells(Rows.Count, 1).End(xlUp).Rowarr = Range("a1:o" & r)'省略一些,理解思路即可d(arr(i, 2)) = d(arr(i, 2)) &...原创 2020-04-22 10:19:37 · 2131 阅读 · 0 评论 -
VBA|wh.Range("a1048576").End(xlUp).Row溢出
原因是:integer:只能表示整数,不能有小数点,正负数都可以,最大32767。Long:也只能表示整数,正负都可以,最大2147483648。sheet中的数据十几万行所以导致溢出,把integer换成long即可解决。在获取sheet最后一行,并清空内容时,使用的代码如下:Sub clear() Dim wb As Workbook Set wb = T...原创 2020-04-20 09:32:25 · 4871 阅读 · 0 评论 -
MySQL|where中between时间日期的处理方法
select * from table where date between date1 and date2如果date1 = "2020/4/6",date2 = "2020/4/7",取值范围是date1零点到date2零点。若要取date2一整天,可以在date2后面拼接 date2 = "2020/4/7"&" "&"23:59:59"(VBA中是这样拼接字符串,其...原创 2020-04-07 10:52:01 · 3956 阅读 · 0 评论