Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hide Rows or Columns with +/- button above row/column label headin | Excel Worksheet Functions | |||
Want to Hide columns in spreadsheet but NOT hide data in chart. | Charts and Charting in Excel | |||
Hide/Unhide columns using button on top over relevant columns | Excel Discussion (Misc queries) | |||
How do I hide columns using a button that slides back and forth | Excel Worksheet Functions | |||
Attaching a particular user defined function to cust button | Excel Discussion (Misc queries) |