• 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
    
  • 相关阅读:
    Defining Database and Instance【数据库与实例】
    安装rlwrap错误的问题解决方法
    ORACLE CONTROL FILE 笔记
    NTP时间服务器配置与解析
    虚拟机下Linux系统安装vmtool工具
    ORACLE clusterware组成
    ORACLE RAC集群硬件资源管理与单节点的区别
    Clusterware后台进程
    oracle数据库重建EM
    微机原理之计算机系统导论
  • 原文地址:https://www.cnblogs.com/yizhangheka/p/14604381.html
Copyright © 2020-2023  润新知