摘要: Sub ttt() t = Timer Application.DisplayAlerts = False '清空数据 Sheets("买卖4").Select Range("B2:K15").Select Selection.ClearContents Sheets("买卖M").Select Range("B2:K15").Select Selection.ClearContents She... 阅读全文
posted @ 2019-07-20 23:10 瓶子xf 阅读(1182) 评论(0) 推荐(0) 编辑
摘要: Sub shishi() Range("e2") = Split(Range("e1"), "-")(0) '用短横线分隔后取第1个值 End Sub ---------------- Sub shishi() Dim arr(1 To 5) '声明数组 For i = 1 To 5 arr(i) = Range("b" & i + 1) * Range("c" & i + 1) Next... 阅读全文
posted @ 2019-07-20 23:05 瓶子xf 阅读(300) 评论(0) 推荐(0) 编辑
摘要: Sub shishi() '执行时间 t = Timer msgBox format(Timer -t,"0.00000") End Sub 阅读全文
posted @ 2019-07-20 23:04 瓶子xf 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Sub 改格式() ActiveWorkbook.activesheet.Select For Each Rng In ActiveSheet.UsedRange With Rng .NumberFormatLocal = "G/通用格式" .Value = .Value End With Next Rng End Sub 阅读全文
posted @ 2019-07-20 23:03 瓶子xf 阅读(4995) 评论(0) 推荐(0) 编辑
摘要: Sub 分拆工作薄() '分拆工作薄到当前文件夹 Dim sht As Worksheet Dim MyBook As Workbook Application.DisplayAlerts = False '表示不显示警告 Set MyBook = ActiveWorkbook For Each sht In MyBook.Sheets sht.Copy ActiveWorkbook.S... 阅读全文
posted @ 2019-07-20 22:59 瓶子xf 阅读(499) 评论(0) 推荐(0) 编辑
摘要: '合并多个工作薄,并以工作薄的名字给sheet表命名(每个工作薄只有一张表) Sub test() Dim str As String Dim wb As Workbook str = Dir("C:\Users\Administrator\Desktop\6.3_6.7\*.xls*") For i = 1 To 100 Set wb = Workbooks.Open("C:\User... 阅读全文
posted @ 2019-07-20 22:52 瓶子xf 阅读(2760) 评论(0) 推荐(0) 编辑