I want to format a column but to exclude the first row as this is the header:
My current Code is:
Sheets("Sheet1").Columns(3).NumberFormat = "#,##0"
Thank you.
If your list does not contain any blank cells, you can use the shortcut to select entire column but the first row. Select the header or the first row of your list and press Shift + Ctrl + ↓(the drop down button), then the list has been selected except the first row.
Highlight a cell in the left column of your table. On the Home section of the ribbon, click Conditional Formatting , then New Rule . Use a formula to determine which cells to format . Click Format and set Number to Currency , then click OK.
Go to the Table tab on the Ribbon. In the Table Style Options group, select the Header Row check box to hide or display the table headers.
Unless the header is a number you shouldn't need to do this, I don't think. The number format won't affect text (at least not much). But here's a way:
With ThisWorkbook.Sheets("Sheet1")
.Columns(3).Resize(.Rows.Count - 1, 1).Offset(1, 0).NumberFormat = "#,##0"
End With
Alternatively
Sheets("Sheet1").Range(cells(2,3), cells(2,3).end(xldown)).NumberFormat = "#,##0"
This would select not the entire column, but the range from your first to last non-blank row. If you have empty cells in between your first and last row, this is not an appropriate solution, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With