FrenchCelt
Board Regular
- Joined
- May 22, 2018
- Messages
- 214
- Office Version
- 365
- Platform
- Windows
Hello, I'm trying to add an outside border to a range of cells that starts at a constant cell (A7), but extends down a variable number of rows and across a variable number of columns. The Excel spreadsheet will be different in terms of rows & columns each day, so I want to add this part to my formatting macro that can do it automatically. Can anyone point me in the right direction? I've seen various examples for dynamic rows. For example, I have this within my own macro earlier after adding a new column and doing a formula fill down:
I would try to adapt this to add an outside border after doing some more formatting, but I don't know how to account for the dynamic number of columns.
Code:
With Range("B8:B" & Range("B" & Rows.Count).End(xlUp).Row).Borders
.LineStyle = xlContinuous
.Weight = xlMedium
I would try to adapt this to add an outside border after doing some more formatting, but I don't know how to account for the dynamic number of columns.