View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default display only columns A to I

In a module put:

Sub Macro1()
Columns("A:IV").EntireColumn.Hidden = False
Columns("J:IV").EntireColumn.Hidden = True
End Sub


In worksheet code for sheet1 put:

Private Sub Worksheet_Activate()
Call Macro1
End Sub
--
Gary's Student


"John Smith" wrote:

I want users to be able to see only columns A to I. The following
code works in the worksheet_selectionchange() but I don't want it
to execute everytime users make a change on the sheet. If I put
the code in a module, no column is visible. The sheet is
completely blank. Any help?


Sheets("sheet1").Columns.Hidden = True
Sheets("sheet1").Columns("A:I").Hidden = false
Sheets("sheet1").Columns("A:I").Show