Excel精英培训网

 找回密码
 注册
    正则的实例解释
    lingyuncelia1 2016-4-24 13:12
    正则的实例解释
    Sub yy() Dim brr(1 To 10000, 1 To 5) arr = .CurrentRegion Set regx = CreateObject("vbscript.regexp") regx.Pattern = "(\d{6})(.*省)(.*市)(.*)" '查找规则:4个子规则分别为 (6位数字) (X省) (X ...
    466 次阅读|0 个评论
    在变量数组里计算符合条件字符的次数
    lingyuncelia1 2016-4-24 09:43
    在变量数组里计算符合条件字符的次数
    Sub 在变量数组里计算符合条件字符的次数() For i = 1 To 20 If Cells(i, 1) = 1 Then arr = Cells(i, 2): Cells(i, 3) = arr Next n = Application.WorksheetFunction.CountIf(Columns("c:c"), "=1") Columns("c:c").ClearContents If n = 1 Then MsgBox "Wonderful" End Sub
    416 次阅读|0 个评论
    时间区间
    lingyuncelia1 2016-4-23 21:34
    Sub celia() For i = 1 To 2 If TimeValue("6:0:0") Cells(i, 1) And Cells(i, 1) TimeValue("7:0:0") Then MsgBox "ok" End If Next mycount = Application.WorksheetFunction.CountIfs(Columns("a:a"), "" TimeValue("6:0:0"), Columns("a:a"), "" TimeValue("7:0:0")) If mycount = 1 Then Ms ...
    468 次阅读|0 个评论
    Function fncombine(myrange As Range)
    lingyuncelia1 2016-4-23 09:38
    Function fncombine(myrange As Range) Dim strcombine As String Dim mycell As Range strcombine = "" For Each mycell In myrange If mycell.Value "" Then strcombine = strcombine mycell.Value "," End If Next strcombine = Left(strcombine, Len(strcombine) - 1) fncombine = strcombine End Func ...
    651 次阅读|0 个评论
    Function fenli(rngmix As Range)
    lingyuncelia1 2016-4-23 09:36
    Function fenli(rngmix As Range) For i = 1 To Len(rngmix.Value) mystr = Mid(rngmix.Value, i, 1) If IsNumeric(mystr) Then shuzi = shuzi mystr Else hanzi = hanzi mystr End If Next fenli = shuzi End Function
    433 次阅读|0 个评论

    本页有 2 篇日志因作者的隐私设置或未通过审核而隐藏

    12345

    小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

    GMT+8, 2024-5-19 15:41 , Processed in 0.141331 second(s), 6 queries , Gzip On, Yac On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    返回顶部