chen9771的个人空间 https://blog.eetop.cn/?15885 [收藏] [复制] [分享] [RSS]

日志

VBA

已有 321 次阅读| 2025-9-15 14:45 |系统分类:其他

Public Sub Wafer_Mapping_Tag()
    Dim die As Range
    Dim die_row As Long
    Dim die_column As Long
    Dim die_row_in_frame As Long
    Dim die_col_in_frame As Long
    Dim frame_row As Long
    Dim frame_column As Long
    Dim frame_any_bottom As Long
    Dim frame_any_right As Long
    Dim frame_row_add As Long
    Dim frame_column_add As Long
    Dim wafer_arr As Range
    Dim hang
    Dim lie

    
'---------------------------------modified---------------------------------
    frame_row = 20 'hang
    frame_column = 39 'lie
    frame_any_bottom = 59
    frame_any_right = 136
    hang = 1
    lie = 2
'--------------------------------------------------------------------------
    Application.ScreenUpdating = False
    
    Set wafer_arr = Sheet1.UsedRange
    
    Sheet1.UsedRange.ClearFormats
    
    
    frame_row_add = frame_row - (frame_any_bottom Mod frame_row)
    frame_column_add = frame_column - (frame_any_right Mod frame_column)

    For Each die In wafer_arr
    
        die_row = die.Row + frame_row_add
        die_column = die.Column + frame_column_add
        
        die_row_in_frame = die_row Mod frame_row
        die_col_in_frame = die_column Mod frame_column
    
          If die_row_in_frame Mod hang = 1 Then
            die.Borders(xlEdgeTop).LineStyle = xlContinuous
            die.Borders(xlEdgeTop).Weight = xlThin
        ElseIf die_row_in_frame Mod hang = 0 Then
            die.Borders(xlEdgeBottom).LineStyle = xlContinuous
            die.Borders(xlEdgeBottom).Weight = xlThin
        End If
        
          If die_col_in_frame Mod lie = 1 Then
            die.Borders(xlEdgeLeft).LineStyle = xlContinuous
            die.Borders(xlEdgeLeft).Weight = xlThin
        ElseIf die_col_in_frame Mod lie = 0 Then
            die.Borders(xlEdgeRight).LineStyle = xlContinuous
            die.Borders(xlEdgeRight).Weight = xlThin
        End If


        If die_row_in_frame = 1 Then
            die.Borders(xlEdgeTop).LineStyle = xlContinuous
            die.Borders(xlEdgeTop).Weight = xlThick
        ElseIf die_row_in_frame = 0 Then
            die.Borders(xlEdgeBottom).LineStyle = xlContinuous
            die.Borders(xlEdgeBottom).Weight = xlThick
        End If
        If die_col_in_frame = 1 Then
            die.Borders(xlEdgeLeft).LineStyle = xlContinuous
            die.Borders(xlEdgeLeft).Weight = xlThick
        ElseIf die_col_in_frame = 0 Then
            die.Borders(xlEdgeRight).LineStyle = xlContinuous
            die.Borders(xlEdgeRight).Weight = xlThick
        End If
    
        If die.Value = "." Then
            die.Value = "."
            die.Interior.Color = RGB(255, 255, 255)
        ElseIf die.Value = "X" Then
            die.Value = "X"
            die.Interior.Color = RGB(255, 0, 0)
        
        Else
            If die_row_in_frame = 0 Then
                die_row_in_frame = frame_row
            End If
            
            If die_col_in_frame = 0 Then
                die_col_in_frame = frame_column
            End If

            die.Value = Sheet2.Cells(die_row_in_frame, die_col_in_frame).Value
            die.Interior.Color = Sheet2.Cells(die_row_in_frame, die_col_in_frame).Interior.Color
            
        End If
    Next die

    Application.ScreenUpdating = True
End Sub




点赞

全部作者的其他最新日志

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 1

    关注
  • 1

    粉丝
  • 2

    好友
  • 1

    获赞
  • 3

    评论
  • 25

    访问数
关闭

站长推荐 上一条 /1 下一条


手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-10-8 08:42 , Processed in 0.024218 second(s), 14 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部