向下填充(间断性)

Sub 向下填充()
    Set ws = ActiveSheet
    lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
    
    currentValue = ws.Range("C2").Value
    
    For i = 3 To lastRow
        If ws.Cells(i, "C").Value <> "" Then
            currentValue = ws.Cells(i, "C").Value
        Else
            ws.Cells(i, "C").Value = currentValue
        End If
    Next
End Sub
posted @ 2025-10-15 22:41  python_learn  阅读(2)  评论(0)    收藏  举报