velohead
Board Regular
- Joined
- Aug 22, 2007
- Messages
- 212
Hi All,
I need to automatically amend a column width, which is easy with VB.
Script supplied below.
However, the author of the spreadsheet decided in their wisdom (d'oh!) to incorporate merged cells.
Unfortunately, I need to retain these numerous and illogically placed merged cells.
is there a way to amend the column width with VB please.
It works when you do it manually !!!!
When VB is used, the result is to amend the column width of all columns that have a merged cell that includes that column.
I need to automatically amend a column width, which is easy with VB.
Script supplied below.
However, the author of the spreadsheet decided in their wisdom (d'oh!) to incorporate merged cells.
Unfortunately, I need to retain these numerous and illogically placed merged cells.
is there a way to amend the column width with VB please.
It works when you do it manually !!!!
When VB is used, the result is to amend the column width of all columns that have a merged cell that includes that column.
Code:
Sub Macro7()
x = InputBox("enter column width")
Columns("M:M").Select
Selection.ColumnWidth = x
End Sub