ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subtotals with variable total/sum location (https://www.excelbanter.com/excel-programming/358347-re-subtotals-variable-total-sum-location.html)

Tom Ogilvy

Subtotals with variable total/sum location
 
On the limited information provided, that sounds attractive:

It is actually select case

Select Case sh.name
Case "Sheet1"

Case "Sheet2"

Case Else

end Select

--
Regards,
Tom Ogilvy


"Dawn Bjork Buzbee" wrote:

I am editing a macro that was working until the scope was expanded:

1) selects a variable range for sorting and subtotals
2) sorts on 2 key fields (columns are same for all worksheets)
3) creates nested subtotals (the GroupBy columns are consistent); the total
column varies with each worksheet (about 10)

I want to easily set the column position (Array) for the totals. Is Do Case
the best option when there are at least 10 different variations?

Any examples would be very appreciated!
--
Dawn Bjork Buzbee



All times are GMT +1. The time now is 10:29 AM.

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