2021-12-15

〔VBA〕從非連續的選取區取每個Cell值(Selection.Areas)--v057

       

【從非連續的選取區取每個Cell值(Selection.Areas)】

Dim sArea  As Range
Dim sCell As Range
For Each sArea In Selection.Areas
    For Each sCell In sArea.Cells
        MsgBox sCell.Value
    Next
Next
Set sArea = Nothing: Set sCell = Nothing



相關課程:


章老師的電腦小講堂 https://www.facebook.com/ScenicSchool/
※※ 本區做為經常使用之程式碼複製區,提問請至小講堂唷 ※※

5 章老師的電腦小講堂: 〔VBA〕從非連續的選取區取每個Cell值(Selection.Areas)--v057         【從非連續的選取區取每個Cell值(Selection.Areas)】 Dim sArea  As Range Dim sCell As Range For Each sArea In Selection.Areas     For Each sCell In s...
小講堂經過多次搬移,舊文章連結及內容較難整理~
大家可以新文章為主~
每篇文章後有代碼,任何文章問題可至FB小講堂用代碼提問唷~