Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code works fine for me.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "John Smith" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chip Pearson wrote:
Your code works fine for me. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where did you put the code? I put it in a module and got a blank sheet,
no columns, no rows, no cells. When I followed the instruction on your web site (BTW, a great site with good info) and progamatically put it in workbook_activate() or worksheet_activate(), same blank sheet I got. It only works when I put it in worksheet_selectionchange() but I think the code should be executed only once, not every time people click on the worksheet. Chip Pearson wrote: Your code works fine for me. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How about Sheets("sheet1").Columns("j:Iv").Hidden = True Will need to change for xl2007 files -- Don Guillett SalesAid Software "John Smith" wrote in message ... 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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put in the Worksheet_Activate event.
Private Sub Worksheet_Activate() Sheets("sheet1").Columns("J:IV").Hidden = True End Sub If they unhide the columns manually, you can re-hide them with this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Sheets("sheet1").Columns("J").Hidden = False Then Sheets("sheet1").Columns("J:IV").Hidden = True Else: Exit Sub End If End Sub Mike F "John Smith" wrote in message ... 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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to Don and Mike. Your suggestions work great.
Mike Fogleman wrote: Put in the Worksheet_Activate event. Private Sub Worksheet_Activate() Sheets("sheet1").Columns("J:IV").Hidden = True End Sub If they unhide the columns manually, you can re-hide them with this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Sheets("sheet1").Columns("J").Hidden = False Then Sheets("sheet1").Columns("J:IV").Hidden = True Else: Exit Sub End If End Sub Mike F "John Smith" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
display columns alphabetically | New Users to Excel | |||
How can I group and display columns automatically? | Excel Worksheet Functions | |||
Compare columns and display the value | Excel Discussion (Misc queries) | |||
Scrolling columns display | Excel Programming | |||
compare two columns and display a third | Excel Discussion (Misc queries) |