Thread: Column Widths
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge
 
Posts: n/a
Default Column Widths

Only with code in say a worksheet_change event, a little like this (Works on
Column A and a value in A1 (Little error checking contained)


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo err:
If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
Application.EnableEvents = False
Columns("A:A").ColumnWidth = Target.Value
Application.EnableEvents = True
End If
err:
Columns("A:A").ColumnWidth= 8.38
Application.EnableEvents = True
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Pricklyflower" wrote in message
...
Is there any way of being able to enter a number into a cell and that
number
will represent the width of the column? For example, if I wanted the cell
to
be a width of 5, I enter that number into a cell in the column?

I hope I've explained that correctly, if not I'll try again!!

Any help will be much appreciated.

Many thanks.