Worksheet.Rows property (Excel)
Returns a Range object that represents all the rows on the specified worksheet.
Syntax
expression.Rows
expression A variable that represents a Worksheet object.
Remarks
Using the Rows property without an object qualifier is equivalent to using ActiveSheet.Rows. If the active document isn't a worksheet, the Rows property fails.
To return a single row, use the Item property or equivalently include an index in parentheses. For example, both Rows(1)
and Rows.Item(1)
return the first row of the active sheet.
Example
This example deletes row three on Sheet1.
Worksheets("Sheet1").Rows(3).Delete
This example deletes all rows on worksheet one where the value of cell one in the row is the same as the value of cell one in the previous row.
For Each rw In Worksheets(1).Rows
this = rw.Cells(1, 1).Value
If this = last Then rw.Delete
last = this
Next
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기