摘要:
主程序: Sub mymain() Dim MainArr, t Application.ScreenUpdating = False t = timer With ThisWorkbook.Worksheets("排序") MainArr = .Range("a2: a" & Cells(Rows 阅读全文
摘要:
实现效果如下: 代码如下: Sub MyCharacters() Dim arr, s$, i&, L&, n& s = InputBox("请输入改变的字符", "提示") '需要改变格式的字符串 n = Len(s) '变量s的长度 If n = 0 Then: Exit Sub Applica 阅读全文
摘要:
VBA采用Application.OnTime实现计时器,代码如下: Public RunWhen As Double Public Const cRunIntervalSeconds = 120 ' two minutes Public Const cRunWhat = "TheSub" ' th 阅读全文
摘要:
1、不重复随机数1 生产[lowerbound,upperbound]的随机数,核心代码:Int((upperbound - lowerbound + 1) * Rnd + lowerbound),示例代码如下: Sub RndNumNoRepeat1() Dim dic Dim i& Set di 阅读全文