• vb,wps,excel 提取括号的数字


    Sub 抽离数字()
    Dim hang
     Range("h1").Select
    
    
      
     Columns("E:F").Select
        Selection.Clear
        
    Range("c3:c190").Select
        
    Selection.Replace What:="(", Replacement:="(", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=False, SearchFormat:=True, ReplaceFormat:=True
    Selection.Replace What:=")", Replacement:=")", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=False, SearchFormat:=True, ReplaceFormat:=True
    
     For ccc = 3 To 100
     
    aa = ActiveSheet.Cells(ccc, 3).Value
    
    bb = Split(aa, "(")
    For aai = 1 To UBound(bb)
    hang = ActiveSheet.Cells(1, 8).Value
    bb2 = Split(bb(aai), ")")
    If Asc(Mid(bb2(0), 1, 1)) > 0 Then
    
    If Int(bb2(0)) > 0 Then
    ActiveSheet.Cells(hang + 3, 6).Value = Int(bb2(0))
    ActiveSheet.Cells(hang + 3, 5).Value = ActiveSheet.Cells(ccc, 2).Value
    End If
    End If
    
    Next
    For ff = 3 To 90
    If ActiveSheet.Cells(ff, 6).Value = 0 Or ActiveSheet.Cells(ff, 6).Value = "" Then
     ActiveSheet.Cells(ff, 6).Select
        Selection.Delete Shift:=xlShiftUp
    End If
    Next
    Next
    '跳到顶端
     ActiveWindow.ScrollRow = 1
       
    
    End Sub
    
    Sub 替换()
    Range("c3:c190").Select
        
    Selection.Replace What:="(", Replacement:="(", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=False, SearchFormat:=True, ReplaceFormat:=True
    Selection.Replace What:=")", Replacement:=")", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=False, SearchFormat:=True, ReplaceFormat:=True
    
    End Sub
    

      H1 输入公式 =COUNT(F:F)

          B3 输入考勤负责人

          C3 为该部门的人 ,名字(工号)

    博客园:冷色008 百度:冷色008
  • 相关阅读:
    Vue DatePicker和不可用
    API图片路径和超链接语义化转换
    jQuery常用插件大全
    前端面试必备技巧整理
    堆与堆排序/Heap&Heap sort
    第k大的数
    POJ 2083 Fractal 分形题目
    最大子数组问题/Maximum Subarray
    一个简单的随机数生成算法
    成绩排序
  • 原文地址:https://www.cnblogs.com/--3q/p/9135170.html
Copyright © 2020-2023  润新知