會話 片語 短句 94215 句型 諺語 單字


學習Excel VBA

儲存格填值 AND 更新狀態列 (狀態欄) 範例

Public Sub 儲存格填值_AND_更新狀態列範例()
    Dim cel As Range, myrange As Range, myAddress As String
    Cells.Clear
    Set myrange = Sheet1.Range("A1:K300")
    For Each cel In myrange
        myAddress = cel.Address(RowAbsolute:=False, ColumnAbsolute:=False)
        Application.StatusBar = " ----------- " & myAddress & " +++++++++++ "
        cel.Value = cel.Value + 1
    Next
    Application.StatusBar = False
End Sub