ststern45
Well-known Member
- Joined
- Sep 17, 2005
- Messages
- 974
- Office Version
- 365
- 2010
- Platform
- Windows
Hi everyone,
I need help with VBA code.
I would like to re-size the columns H through M based on the maximum number of characters (numbers & dashes) in each cells
For example column H there are 30 cells that may range anywhere from 6 to 24 characters in each cell.
Problem is cell range H7 through M7 and H8 through M8 are merged cells.
If I run the current macro it defaults to width of 8 due to the merged cells (H7 through M7 and H8 through M8)
Column M is the last column
All columns H through M have a column width of 8
Column H
Selection.ColumnWidth = 20
Column i
Selection.ColumnWidth = 16
Column j
Selection.ColumnWidth = 12
Column k
Selection.ColumnWidth = 12
Column l
Selection.ColumnWidth = 10
Column m
Selection.ColumnWidth = 8
Thank you in advance
I need help with VBA code.
I would like to re-size the columns H through M based on the maximum number of characters (numbers & dashes) in each cells
For example column H there are 30 cells that may range anywhere from 6 to 24 characters in each cell.
Problem is cell range H7 through M7 and H8 through M8 are merged cells.
If I run the current macro it defaults to width of 8 due to the merged cells (H7 through M7 and H8 through M8)
Column M is the last column
All columns H through M have a column width of 8
Column H
Selection.ColumnWidth = 20
Column i
Selection.ColumnWidth = 16
Column j
Selection.ColumnWidth = 12
Column k
Selection.ColumnWidth = 12
Column l
Selection.ColumnWidth = 10
Column m
Selection.ColumnWidth = 8
Thank you in advance