![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
Using Excel XP. If I highlight a column, right click and select hide, the column hides
completly. Is there a way to create a one or two key stroke function, or is there a function, that would allow the un-hiding of a specific column to a specific width? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi cpc,
Heres an example, change to suit: Sub UnhideColumn() If Columns("D").EntireColumn.Hidden = True Then Selection.EntireColumn.Hidden = False Selection.ColumnWidth = 20 End If End Sub James |
|
|
|
|
|
#3 |
|
Join Date: May 2002
Posts: 73
|
Alternatively, you could un-hide any column and set the width, by selecting any cell(s) in the column immediately to the left of the hidden column and then run the following :-
Sub UnhideNextColumn() With ActiveCell(1, 2).EntireColumn .Hidden = False .ColumnWidth = 20 End With End Sub |
|
|
|
|
|
#4 | |
|
Join Date: May 2002
Posts: 73
|
Quote:
I think James meant to post :- Sub UnhideColumn() If Columns("D").EntireColumn.Hidden = True Then Columns("D").EntireColumn.Hidden = False Columns("D").ColumnWidth = 20 End If End Sub (Presumably his typo arose because of the pressure arising from his on-going project of how to sum two cells.) [ This Message was edited by: dimrod on 2002-05-17 04:56 ] |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Toronto
Posts: 73
|
Just for completeness: don't forget you can select toolbar button: ,
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Location: Toronto
Posts: 73
|
That last post didn't print as intended. I meant to say; Click on toolbar button DATA, select GROUP & OUTLINE, select GROUP, & select COLUMN. In future to hide & unhide the selected column, click on the "1" or "2" button in the upper left corner.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|