Iterating through populated rows

前端 未结 3 1171
北恋
北恋 2020-11-27 14:09

So I am trying to iterate through a worksheet in an Excel spreadsheet using VBA. I want to iterate through each row, and then through each column, and despite googling, I ca

3条回答
  •  星月不相逢
    2020-11-27 14:39

    For the benefit of anyone searching for similar, see worksheet .UsedRange,
    e.g. ? ActiveSheet.UsedRange.Rows.Count
    and loops such as
    For Each loopRow in Sheets(1).UsedRange.Rows: Print loopRow.Row: Next

提交回复
热议问题