Row and Column Basics. MS Excel is in tabular format consisting of rows and columns. Row runs horizontally while Column runs vertically. Each row is identified by row number, which runs vertically at the left side of the sheet. Resizing Rows and Columns in Excel. September 29, 2016 Excel Tips msadmin. The width of columns and height of rows can be adjusted to better fit your data in a few different ways. Drag the border. Hover your arrow over the border between the column or row labels. Then click and drag the border to widen or narrow the size of each cell.
-->Use the Rows property or the Columns property to work with entire rows or columns. These properties return a Range object that represents a range of cells. In the following example,
Rows(1)
returns row one on Sheet1. The Bold property of the Font object for the range is then set to True.The following table illustrates some row and column references using the Rows and Columns properties.
Reference | Meaning |
---|---|
Rows(1) | Row one |
Rows | All the rows on the worksheet |
Columns(1) | Column one |
Columns('A') | Column one |
Columns | All the columns on the worksheet |
To work with several rows or columns at the same time, create an object variable and use the Union method, combining multiple calls to the Rows or Columns property. The following example changes the format of rows one, three, and five on worksheet one in the active workbook to bold.
Sample code provided by: Dennis Wallentin, VSTO & .NET & ExcelThis example deletes the empty rows from a selected range.
This example deletes the empty columns from a selected range.
About the Contributor
Dennis Wallentin is the author of VSTO & .NET & Excel, a blog that focuses on .NET Framework solutions for Excel and Excel Services. Dennis has been developing Excel solutions for over 20 years and is also the coauthor of 'Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA and .NET (2nd Edition).'
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.