• 举证信息表,语言不是VB.NET 是VBA的


    Sub tt()
         Dim i As Integer
         For i = 2 To ActiveSheet.UsedRange.Rows.Count
          If Sheets(1).Cells(i, 6) <> "" Then
             Dim j As Integer
             For j = 2 To 153
                 If Sheets(1).Cells(i, 6) = Sheets(2).Cells(j, 1) Then
                    If Sheets(1).Cells(i, 7) = Sheets(2).Cells(j, 2) Then
                       Sheets(1).Cells(i, 6) = ""
                       Sheets(1).Cells(i, 7) = ""
                                       Sheets(1).Cells(i, 9) = Sheets(2).Cells(j, 1)
                    Sheets(1).Cells(i, 10) = Sheets(2).Cells(j, 2)
                    Sheets(2).Cells(j, 3) = "Find"
                 Else
                    Sheets(1).Cells(i, 9) = Sheets(2).Cells(j, 1)
                    Sheets(1).Cells(i, 10) = Sheets(2).Cells(j, 2)
                    Sheets(2).Cells(j, 3) = "Find"
                    End If
                 End If 
             Next j
          End If
         Next i
    End Sub

    慎用

    Sub tt()
         Dim i As Integer
         For i = 2 To ActiveSheet.UsedRange.Rows.Count
          If Cells(i, 6) <> "" Then
             Dim n As Integer
             For n = 0 To 15
                 If Cells(i, 6) <> Cells(i - 1, 6) And Cells(i, 6) = Cells(i + n, 6) Then
                    If Cells(i, 10) <> "" Then
                       Cells(i, 10) = Cells(i, 10) & "/" & Cells(i + n, 7)
                    End If
                    If Cells(i, 10) = "" Then
                       Cells(i, 10) = Cells(i + n, 7)
                    End If
                   
                 End If
             Next n
          End If
         Next i
    End Sub

    将举证信息表,导出为EXCEL表,6列为标识码,7列为举证号。先以标识码排序,然后运行,在10列产生新的举证号,最后排序。

  • 相关阅读:
    Java MVC和三层架构
    EL表达式
    EL表达式中的11个隐式对象
    JDBC连接数据库7个步骤
    JSP九大内置对象和四个作用域
    Eclipse常用快捷键大全
    Java的绝对路径和相对路径
    Servlet中相对路径与绝对路径
    mysql8的深坑
    mysql单列索引和联合索引
  • 原文地址:https://www.cnblogs.com/RedLn/p/14222904.html
Copyright © 2020-2023  润新知