Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to hide pre-defined columns at the touch of a button

Scenario:
I have multiple spreadsheets which have predefined columns (i.e. Product, Price, Quantity, Total)
I wish to be able to hide predefined columns (i.e. Product and Total)
Ideally it should be in the form of a macro with a button on the toolbar (or an added menu item) so that I can apply it to spreadsheets which I load

Any ideas would be greatly appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default How to hide pre-defined columns at the touch of a button

Paresh,

If you only have Total and Product appearing once, then copy this macro into
your personal.xls and assign it to a commandbar button:

Sub HideTotalProduct()
Cells.Find(What:="Total", _
LookAt:=xlWhole).EntireColumn.Hidden = True
Cells.Find(What:="Product", _
LookAt:=xlWhole).EntireColumn.Hidden = True
End Sub

HTH,
Bernie
MS Excel MVP

"Paresh" wrote in message
...
Scenario:
I have multiple spreadsheets which have predefined columns (i.e. Product,

Price, Quantity, Total)
I wish to be able to hide predefined columns (i.e. Product and Total)
Ideally it should be in the form of a macro with a button on the toolbar

(or an added menu item) so that I can apply it to spreadsheets which I load

Any ideas would be greatly appreciated



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to hide pre-defined columns at the touch of a button

Bernie

Thank you for your suggestion. It seems to do the trick. My question though is what is 'personal.xls'? How do I write this code such that the function is available at all times for any spreadsheet I load

Paresh
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default How to hide pre-defined columns at the touch of a button

Paresh,

Personal.xls is a macro library. To create one, turn on the macro recorder,
and when prompted as to where to save the macro, choose "Personal Macro
Workbook" Then click Ok, click the stop button, then go into the VBE using
Alt-F11, and your personal.xls will be available there for you to store
macros in and have them available every time you open Excel.

HTH,
Bernie
MS Excel MVP

"Paresh" wrote in message
...
Bernie,

Thank you for your suggestion. It seems to do the trick. My question

though is what is 'personal.xls'? How do I write this code such that the
function is available at all times for any spreadsheet I load?

Paresh



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Rows or Columns with +/- button above row/column label headin WA Excel Worksheet Functions 3 April 5th 23 02:42 PM
Want to Hide columns in spreadsheet but NOT hide data in chart. KrispyData Charts and Charting in Excel 1 March 20th 09 04:45 PM
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
How do I hide columns using a button that slides back and forth Virginia53 Excel Worksheet Functions 1 May 28th 05 12:51 AM
Attaching a particular user defined function to cust button Ajay Excel Discussion (Misc queries) 3 February 23rd 05 08:29 AM


All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"