ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Views based on sheet name (https://www.excelbanter.com/excel-programming/310793-re-custom-views-based-sheet-name.html)

Tom Ogilvy

Custom Views based on sheet name
 
ActiveWorkbook.CustomViews(ActiveWorksheet.Name & "Summary").Show

--
Regards,
Tom Ogilvy

"StephanieH" wrote in message
...
I have a workbook with approx 17 pages. Each page has 3 custom views.

The
views use the sheet name followed by Summary, Detail or Both ie..
ProductSummary, ProductDetail or ProductBoth.

I also have a dialog box that allows the user to select their view
ActiveWorkbook.CustomViews("ProductSummary").Show
but setting up a macro for each view for each page is getting very

tedious.

Is it possible to use one macro that will insert the name of the active
sheet if they push a button named Summary so there isn't a macro for each
page?

I'm thinking something like
ActiveWorkbook.CustomViews("Active.Worksheet"Summa ry).Show
but this doesn't appear to work......
Any ideas?





StephanieH

Custom Views based on sheet name
 
Yeah! Thanks Tom.

I had to use
ActiveWorkbook.CustomViews(ActiveSheet.Name & "Summary").Show
but it's working!

"Tom Ogilvy" wrote:

ActiveWorkbook.CustomViews(ActiveWorksheet.Name & "Summary").Show

--
Regards,
Tom Ogilvy

"StephanieH" wrote in message
...
I have a workbook with approx 17 pages. Each page has 3 custom views.

The
views use the sheet name followed by Summary, Detail or Both ie..
ProductSummary, ProductDetail or ProductBoth.

I also have a dialog box that allows the user to select their view
ActiveWorkbook.CustomViews("ProductSummary").Show
but setting up a macro for each view for each page is getting very

tedious.

Is it possible to use one macro that will insert the name of the active
sheet if they push a button named Summary so there isn't a macro for each
page?

I'm thinking something like
ActiveWorkbook.CustomViews("Active.Worksheet"Summa ry).Show
but this doesn't appear to work......
Any ideas?






Tom Ogilvy

Custom Views based on sheet name
 
Activeworksheet - my typo.

--
Regards,
Tom Ogilvy

"StephanieH" wrote in message
...
Yeah! Thanks Tom.

I had to use
ActiveWorkbook.CustomViews(ActiveSheet.Name & "Summary").Show
but it's working!

"Tom Ogilvy" wrote:

ActiveWorkbook.CustomViews(ActiveWorksheet.Name & "Summary").Show

--
Regards,
Tom Ogilvy

"StephanieH" wrote in message
...
I have a workbook with approx 17 pages. Each page has 3 custom views.

The
views use the sheet name followed by Summary, Detail or Both ie..
ProductSummary, ProductDetail or ProductBoth.

I also have a dialog box that allows the user to select their view
ActiveWorkbook.CustomViews("ProductSummary").Show
but setting up a macro for each view for each page is getting very

tedious.

Is it possible to use one macro that will insert the name of the

active
sheet if they push a button named Summary so there isn't a macro for

each
page?

I'm thinking something like
ActiveWorkbook.CustomViews("Active.Worksheet"Summa ry).Show
but this doesn't appear to work......
Any ideas?









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

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