当前位置: 首页 > article >正文

【EXCEL】【VBA】处理GI Log获得Surf格式的CONTOUR DATA

【EXCEL】【VBA】处理GI Log获得Surf格式的CONTOUR DATA

    • data source1: BH coordination table
    • data source2:BH layer table
    • process 1:Collect BH List To Layer Table
    • process 2:match Reduced Level from "Layer"+"BH"

data source1: BH coordination table

data source2:BH layer table

image-20250211221032901

process 1:Collect BH List To Layer Table

Sub FindBHForAllLayers()
    Dim ws As Worksheet
    Dim wsTarget As Worksheet
    Dim resultRow As Long
    Dim col As Long, targetCol As Long
    Dim lastCol As Long
    Dim layerName As String
    
    Set ws = ThisWorkbook.Sheets("Layer summary")
    Set wsTarget = ThisWorkbook.ActiveSheet
    lastCol = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column
    
    ' 清除之前的结果
    wsTarget.Range("C2:ZZ50").ClearContents
    
    ' 遍历每个可能的layer起始列(B,G,L...)
    For targetCol = 2 To lastCol Step 5
        layerName = wsTarget.Cells(1, targetCol).Value
        If Not IsEmpty(layerName) Then
            resultRow = 2 '每个layer从第2行开始填写
            
            ' 在Layer summary中搜索这个layer
            For col = 1 To lastCol Step 5
                If Not IsEmpty(ws.Cells(1, col)) Then
                    ' 检查该组中的Description列是否包含当前layer
                    Dim rng As Range
                    Set rng = ws.Range(ws.Cells(1, col + 3), ws.Cells(50, col + 3))
                    
                    If Not IsError(Application.Match(layerName, rng, 0)) Then
                        ' 写入到layer名称的右边一列
                        wsTarget.Cells(resultRow, targetCol + 1).Value = ws.Cells(1, col).Value
                        resultRow = resultRow + 1
                    End If
                End If
            Next col
        End If
    Next targetCol
End Sub


http://www.kler.cn/a/543006.html

相关文章:

  • 分享在职同时准备系统分析师和教资考试的时间安排
  • centos7 升级openssl并安装python3
  • 从Word里面用VBA调用NVIDIA的免费DeepSeekR1
  • OpenFeign远程调用返回的是List<T>类型的数据
  • HTML 属性
  • 使用PyCharm创建项目以及如何注释代码
  • PostgreSQL错误: 编码“UTF8“的字符0x0xe9 0x94 0x99在编码“WIN1252“没有相对应值
  • 【EXCEL】【VBA】最大值行索引查找与Z字形数据重排
  • kamailio关于via那点事
  • 将 AMD Zynq™ RFSoC 扩展到毫米波领域
  • 软件工程-决策树决策表
  • Unity 打造游戏资源加密解密系统详解
  • ElementUI的<el-image>组件引用网络图片加载失败
  • 从词袋到Transformer:自然语言处理的演进与实战
  • Maven 多模块项目管理
  • 回溯---相关习题,经验总结
  • DeepSeek-V2 论文解读:混合专家架构的新突破
  • 青少年编程与数学 02-009 Django 5 Web 编程 07课题、数据迁移
  • 从零构建高可用MySQL集群:Percona XtraDB Cluster 实战部署
  • 《qt open3d中添加最远点采样》
  • STM32 如何将printf函数和串口函数重定向
  • Redis主从复制高延迟问题解决思路
  • 【Elasticsearch】Bucket Selector Aggregation
  • 微信小程序的behaviors和vuex功能对比
  • 如何在Java中使用JUnit进行单元测试
  • 19.1.2 DML