Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Grouped Tab Alert

hi there


i am looking to make an alert that pops up when a file is opened and any of
the tabs are 'grouped'.

I realise this may seem a bit stupid bearing in mind the filename at the top
clearly goes to "filename.xls [Grouped]" in such an event, but i really need
to ram it down peoples throats if some crazy fool has saved a file with
grouped tabs.

So, i am currently thinking i need some sort of 'Private Sub
Workbook_Open()' with an If function that says "if any of the tabs are
grouped (preferably without having to specifically name all the tabs & all
their possible grouping permutations!) show a 'MsgBox' with a 'vbOKonly' to
warn them, otherwise, let it open as normal".

I am struggling to program the initial part of the If that looks to see if
Sheets are laid out in an Array (which i am using currently as VB's code for
the term "Grouped").

Does anyone have any ideas?

I suppose i could also use a working version of such a code to issue a
strongly worded reprimand to someone attempting to save the file while tabs
are grouped with a 'Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)'?

As always, any help gratefully received, let me know if you need any more info

cheers

jb

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Grouped Tab Alert

Hi JB,

Try something like:

'=============
Private Sub Workbook_Open()
If ThisWorkbook.Windows(1).SelectedSheets.Count 1 Then
'do something, e.g
MsgBox ThisWorkbook.Windows(1).SelectedSheets.Count _
& " Sheets are grouprd"
End If
End Sub
'<<=============


---
Regards,
Norman


"JB2010" wrote in message
...
hi there


i am looking to make an alert that pops up when a file is opened and any
of
the tabs are 'grouped'.

I realise this may seem a bit stupid bearing in mind the filename at the
top
clearly goes to "filename.xls [Grouped]" in such an event, but i really
need
to ram it down peoples throats if some crazy fool has saved a file with
grouped tabs.

So, i am currently thinking i need some sort of 'Private Sub
Workbook_Open()' with an If function that says "if any of the tabs are
grouped (preferably without having to specifically name all the tabs & all
their possible grouping permutations!) show a 'MsgBox' with a 'vbOKonly'
to
warn them, otherwise, let it open as normal".

I am struggling to program the initial part of the If that looks to see if
Sheets are laid out in an Array (which i am using currently as VB's code
for
the term "Grouped").

Does anyone have any ideas?

I suppose i could also use a working version of such a code to issue a
strongly worded reprimand to someone attempting to save the file while
tabs
are grouped with a 'Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)'?

As always, any help gratefully received, let me know if you need any more
info

cheers

jb



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Grouped Tab Alert

If ActiveWindow.Selectedsheets.count 1 then


or

if thisworkbook.Windows(1).SelectedSheets.count 1 then

--
Regards,
Tom Ogilvy



"JB2010" wrote:

hi there


i am looking to make an alert that pops up when a file is opened and any of
the tabs are 'grouped'.

I realise this may seem a bit stupid bearing in mind the filename at the top
clearly goes to "filename.xls [Grouped]" in such an event, but i really need
to ram it down peoples throats if some crazy fool has saved a file with
grouped tabs.

So, i am currently thinking i need some sort of 'Private Sub
Workbook_Open()' with an If function that says "if any of the tabs are
grouped (preferably without having to specifically name all the tabs & all
their possible grouping permutations!) show a 'MsgBox' with a 'vbOKonly' to
warn them, otherwise, let it open as normal".

I am struggling to program the initial part of the If that looks to see if
Sheets are laid out in an Array (which i am using currently as VB's code for
the term "Grouped").

Does anyone have any ideas?

I suppose i could also use a working version of such a code to issue a
strongly worded reprimand to someone attempting to save the file while tabs
are grouped with a 'Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)'?

As always, any help gratefully received, let me know if you need any more info

cheers

jb

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Grouped Tab Alert

Cheers Tom & Norman, both worked well. the VB formula was much more like an
Excel formula than i was expecting, which gives me encouragement!!!



"Tom Ogilvy" wrote:

If ActiveWindow.Selectedsheets.count 1 then


or

if thisworkbook.Windows(1).SelectedSheets.count 1 then

--
Regards,
Tom Ogilvy



"JB2010" wrote:

hi there


i am looking to make an alert that pops up when a file is opened and any of
the tabs are 'grouped'.

I realise this may seem a bit stupid bearing in mind the filename at the top
clearly goes to "filename.xls [Grouped]" in such an event, but i really need
to ram it down peoples throats if some crazy fool has saved a file with
grouped tabs.

So, i am currently thinking i need some sort of 'Private Sub
Workbook_Open()' with an If function that says "if any of the tabs are
grouped (preferably without having to specifically name all the tabs & all
their possible grouping permutations!) show a 'MsgBox' with a 'vbOKonly' to
warn them, otherwise, let it open as normal".

I am struggling to program the initial part of the If that looks to see if
Sheets are laid out in an Array (which i am using currently as VB's code for
the term "Grouped").

Does anyone have any ideas?

I suppose i could also use a working version of such a code to issue a
strongly worded reprimand to someone attempting to save the file while tabs
are grouped with a 'Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)'?

As always, any help gratefully received, let me know if you need any more info

cheers

jb

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouped Items won't Stay Grouped When Moving Object Heather02 Excel Discussion (Misc queries) 0 February 12th 09 07:08 PM
create alert when in sheets are grouped Twishlist Excel Worksheet Functions 1 April 5th 07 04:50 AM
How to Create Sound Alert and Email Alert when Macro is Finish Tom Ogilvy Excel Programming 0 November 30th 06 11:12 PM
How to Create Sound Alert and Email Alert when Macro is Finish Bob Phillips Excel Programming 0 November 30th 06 09:21 PM
How to Create Sound Alert and Email Alert when Macro is Finished Bob Davison Excel Programming 0 November 30th 06 08:14 PM


All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"