zoukankan      html  css  js  c++  java
  • VBA常用操作

    常用操作

    删除掉演示数据

        ' 自动删除第四行
        Rows(4).Select
        Selection.EntireRow.Delete
    

    已撤销、拒绝

    For L = Sheets(1).Range("a65536").End(xlUp).Row To 1 Step -1
      If Range("C" & L) = "已撤销" Then
       Range("C" & L).Select
       Selection.EntireRow.Delete
       End If
    
        If Range("D" & L) = "拒绝" Then
       Range("D" & L).Select
       Selection.EntireRow.Delete
      End If
    Next
    

    标黄工号异常的

     q = Sheets(1).Range("a65536").End(xlUp).Row
     For i = 4 To q
        k = Len(Range("a" & i).Value)
        If k > 10 Then
        Rows(i).Select
            With Selection.Interior
                .PatternColorIndex = xlAutomatic
                .Color = 65535
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
        End If
    Next
    
    Sub 请假_第二步()
    Excel.Application.DisplayAlerts = False
        q = Sheets(1).Range("a65536").End(xlUp).Row
        For i = 4 To q
        k = Len(Range("D" & i).Value)
        If k = 10 Then
                Range("d" & i).Select
                Selection.EntireRow.Delete
        End If
    Next
    Excel.Application.DisplayAlerts = True
    
    MsgBox "已经为您把标黄的行全部删除了,请继续执行第三步"
    End Sub
    

    去掉已离职

        Columns("C:C").Select
        Selection.Replace What:="(已离职)", Replacement:="", LookAt:=xlPart, _
         SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    

    窗口提示

    MsgBox ""
    

    静默

    Application.ScreenUpdating = False
    Excel.Application.DisplayAlerts = False
    
    
    Application.ScreenUpdating = True
    Excel.Application.DisplayAlerts = True
    
  • 相关阅读:
    删除CSDN上传图片水印
    Win10任务栏中隐藏/恢复日期显示
    使用idea和gradle编译spring5源码
    错误:找不到或无法加载主类
    判断字符串是否为数字
    mysql根据json数据过滤
    mysql当不存在时插入
    org.apache.xerces.parsers.SAXParser
    mybatis mapper判断if条件写法
    《Java面向对象编程》
  • 原文地址:https://www.cnblogs.com/yizhangheka/p/14604381.html
Copyright © 2011-2022 走看看