ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Thorny Problem (https://www.excelbanter.com/excel-programming/304948-thorny-problem.html)

No Name

Thorny Problem
 
Suppose I have 14 sheets. the first 5 information and
the rest (6-14) are available to filter and print.

Suppose the user starts at 9 and selects the next 3 (9-12)
No problem - I can capture the start sheet and increment
the next 3.

Suppose the user selects 9 and the previous 3 (9-6).
Is there some mathmatical calc that I can perform that
will tell me if he selected to the left or right and this
ensure that he prints/filters the correct selection.

Thanks,
Glen

Norman Jones

Thorny Problem
 
Hi, Glen,

I assume this is realted to your last question and that you now know how
many worksheets are selected but not which sheets.
Perhaps this will help:

Sub Tester()
Dim SH As Worksheet

For Each SH In ActiveWindow.SelectedSheets
MsgBox SH.Name
Next SH
End Sub


---
Regards,
Norman


wrote in message
...
Suppose I have 14 sheets. the first 5 information and
the rest (6-14) are available to filter and print.

Suppose the user starts at 9 and selects the next 3 (9-12)
No problem - I can capture the start sheet and increment
the next 3.

Suppose the user selects 9 and the previous 3 (9-6).
Is there some mathmatical calc that I can perform that
will tell me if he selected to the left or right and this
ensure that he prints/filters the correct selection.

Thanks,
Glen




Stan Scott

Thorny Problem
 
Glen,

When you say that the user "selects sheets", do you mean she clicks on the
sheet tabs and does a multiple sheet selection?? If so, the SelectedSheets
property (e.g. ActiveWorkbook.Windows(1).SelectedSheets returns what you're
looking for.

Stan Scott
New York City

wrote in message
...
Suppose I have 14 sheets. the first 5 information and
the rest (6-14) are available to filter and print.

Suppose the user starts at 9 and selects the next 3 (9-12)
No problem - I can capture the start sheet and increment
the next 3.

Suppose the user selects 9 and the previous 3 (9-6).
Is there some mathmatical calc that I can perform that
will tell me if he selected to the left or right and this
ensure that he prints/filters the correct selection.

Thanks,
Glen





All times are GMT +1. The time now is 01:32 AM.

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