トップページ(目次)

226.離れた複数セルを選択/入力する

<実行前後>
 → 
Sub 離れた複数セルを選択_入力する()
    
    '4つとも同じ動作
    Range("A1,B2,C3").Select
    Range("A1,B2,C3") = "A"
    
    Union(Range("A2"), Range("B3"), Range("C4")).Select
    Union(Range("A2"), Range("B3"), Range("C4")) = "B"
    
    Union(Cells(3, 1), Cells(4, 2), Cells(5, 3)).Select
    Union(Cells(3, 1), Cells(4, 2), Cells(5, 3)) = "C"
    
    Union(Cells(4, "A"), Cells(5, "B"), Cells(6, "C")).Select
    Union(Cells(4, "A"), Cells(5, "B"), Cells(6, "C")) = "D"

End Sub

Copyright © 2021 https://excel3000.web.fc2.com/ All Rights Reserved.
    inserted by FC2 system