hiding columns

bruise_pristene

New Member
Joined
Aug 27, 2003
Messages
31
hi, I have read other threads on this subject but as i don't really understand vba am unable to adapt them to what I need and am hoping you can help.


In my workbook I have columns which are set to be filled in the future, as my worksheet is getting busy i would like to be able to hide these "blank" columns, by clicking a button. The only problem is these columns aren't blank as they have titles at the top.


I would also need a button to unhide these columns. Would this be possible by having a user promt saying something like "which column" and it unhides the column I type in?


I know this is a lot, and any helo on any of it would be much appreciated


thanx in advance
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Is the basic "Hide" Option in the right click menu ( just highlight the column to be hidden, right click, and you have a HIDE and UNHIDE option) not an option ??

(y)
 
Upvote 0
thanx for the reply. this would be time consuming as there are a lot of columns. Also the people i have in mind to use this workbook are not too excel savvy (even less than me!! :wink: ) so i would prefer a button click.

sorry to be awkward
 
Upvote 0
Set the sheet up just as you want it to appear to the users. Then Goto View|Custom Views. Click on the Add button, and then specify a name for your view (like Report or something).

Then go back to your spreadsheet, and unhide all the columns/rows, and repeat the step above, but name it FullView or something like that. Then the users can switch between these views using the Custom View method.

This would not require any VBA. :devilish:
 
Upvote 0
hi, thanx for the suggestion, i tried using the custom views but whenever i hid columns and named it as a view, when i went back to that view the idden columns appeared still. dont know what i'm doing wrong
 
Upvote 0
oh ok i found what i was doing wrong, is there a way to use a button on the worksheet to switch between these custom views instead of going through all the menus?
 
Upvote 0
Sure...assuming the names I mentioned earlier...assign the ShowAll code to a button to show the full view, and assign the HideColumns code to a button to show the report view.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> ShowAll()
    ActiveWorkbook.CustomViews("FullView").Show
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Sub</SPAN> HideColumns()
    ActiveWorkbook.CustomViews("Report").Show
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top