ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple macro to hide and show detail - Grouped Rows (https://www.excelbanter.com/excel-programming/396912-simple-macro-hide-show-detail-grouped-rows.html)

John

Simple macro to hide and show detail - Grouped Rows
 
Im sure this should be simple however I cant find the answer:

I have a spreadsheet that has been developed for a number of users.
The spreadsheet is protected however I want to alow the users to show
and hide grouped rows without unprotecting the worksheet. There dosnt
appear to be an option to allow this when protecting the sheet.

So i decided to create a simple macro that unprotects the worksheet
selects the appropriate cell then expands the grouping to show the
detail then re protects the worksheet.

If I record the macro the show detail part of the process is not
recorded. Can anyone tell me what the VBA code is to show and hide
detail.


Vergel Adriano

Simple macro to hide and show detail - Grouped Rows
 
Try setting the ShowDetail property to True or False...

something like this if it's grouped by rows:

ActiveSheet.Range("A1").EntireRow.ShowDetail = False



--
Hope that helps.

Vergel Adriano


"John" wrote:

Im sure this should be simple however I cant find the answer:

I have a spreadsheet that has been developed for a number of users.
The spreadsheet is protected however I want to alow the users to show
and hide grouped rows without unprotecting the worksheet. There dosnt
appear to be an option to allow this when protecting the sheet.

So i decided to create a simple macro that unprotects the worksheet
selects the appropriate cell then expands the grouping to show the
detail then re protects the worksheet.

If I record the macro the show detail part of the process is not
recorded. Can anyone tell me what the VBA code is to show and hide
detail.




All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com