Help with columns

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

Hi

How do I create a worksheet with just 3 columns (A, B, C...) rather
than thousands (AA, BB, CC...)?

Thanks!
 
All XL worksheets have exactly 256 columns (and 65536 rows). You can't
change that.

However, if you enter

D:IV

in the Name box (on the left side of the Formula bar), and choose the
menu item

Format/Column/Hide

only 3 columns will be visible.

This doesn't prevent users from using the name box to select cells in
hidden columns. For that you'd need to restrict the selection. Put this
in your worksheet code module (right-click on the worksheet tab and
choose View Code):

Private Sub Worksheet_SelectionChange(ByVal rSelected As Range)
Dim rSelect As Range
Set rSelect = Intersect(Range("A:C"), rSelected)
If rSelect Is Nothing Then
With rSelected
Set rSelect = Me.Cells(.Item(1).Row, 3).Resize( _
.Rows.Count, 1)
End With
End If
rSelect.Select
End Sub
 
If you don't want to just hide the unused columns, then you can just widen
your three used columns to fill the screen, and format all the others with
white background and the gridlines wont show in them.........

Vaya con Dios,
Chuck, CABGx3
 
Back
Top