+ Reply to Thread
Results 1 to 8 of 8

Ungrouping Sheets

  1. #1
    Claude
    Guest

    Ungrouping Sheets

    Hi all
    What is the correct syntax to ungroup sheets in a workbook? I want to make
    sure that no sheets have been grouped by a previous user of the files I'm
    opening (as this causes problems with certain VBA procedures I'm running on
    the files). Can't find anything on this in the VBA help file...
    Thxs!

  2. #2
    Chip Pearson
    Guest

    Re: Ungrouping Sheets

    You just have to select one sheet.

    If ActiveWindow.SelectedSheets.Count > 1 Then
    ActiveWindow.SelectedSheets(1).Select
    End If


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Claude" <Claude@discussions.microsoft.com> wrote in message
    news:7574F3A3-118F-4DC7-BA21-B3E25D1589C2@microsoft.com...
    > Hi all
    > What is the correct syntax to ungroup sheets in a workbook? I
    > want to make
    > sure that no sheets have been grouped by a previous user of the
    > files I'm
    > opening (as this causes problems with certain VBA procedures
    > I'm running on
    > the files). Can't find anything on this in the VBA help file...
    > Thxs!




  3. #3
    Tom Ogilvy
    Guest

    Re: Ungrouping Sheets

    Just select any sheet.

    Worksheets(1).Select

    --
    Regards,
    Tom Ogilvy


    "Claude" <Claude@discussions.microsoft.com> wrote in message
    news:7574F3A3-118F-4DC7-BA21-B3E25D1589C2@microsoft.com...
    > Hi all
    > What is the correct syntax to ungroup sheets in a workbook? I want to make
    > sure that no sheets have been grouped by a previous user of the files I'm
    > opening (as this causes problems with certain VBA procedures I'm running

    on
    > the files). Can't find anything on this in the VBA help file...
    > Thxs!




  4. #4
    Tom Ogilvy
    Guest

    Re: Ungrouping Sheets

    Or
    Activesheet.Select

    --
    Regards,
    Tom Ogilvy


    "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    news:uXkIVHA2FHA.2132@TK2MSFTNGP15.phx.gbl...
    > Just select any sheet.
    >
    > Worksheets(1).Select
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Claude" <Claude@discussions.microsoft.com> wrote in message
    > news:7574F3A3-118F-4DC7-BA21-B3E25D1589C2@microsoft.com...
    > > Hi all
    > > What is the correct syntax to ungroup sheets in a workbook? I want to

    make
    > > sure that no sheets have been grouped by a previous user of the files

    I'm
    > > opening (as this causes problems with certain VBA procedures I'm running

    > on
    > > the files). Can't find anything on this in the VBA help file...
    > > Thxs!

    >
    >




  5. #5
    Claude
    Guest

    Re: Ungrouping Sheets

    Thanks!

    "Chip Pearson" schrieb:

    > You just have to select one sheet.
    >
    > If ActiveWindow.SelectedSheets.Count > 1 Then
    > ActiveWindow.SelectedSheets(1).Select
    > End If
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "Claude" <Claude@discussions.microsoft.com> wrote in message
    > news:7574F3A3-118F-4DC7-BA21-B3E25D1589C2@microsoft.com...
    > > Hi all
    > > What is the correct syntax to ungroup sheets in a workbook? I
    > > want to make
    > > sure that no sheets have been grouped by a previous user of the
    > > files I'm
    > > opening (as this causes problems with certain VBA procedures
    > > I'm running on
    > > the files). Can't find anything on this in the VBA help file...
    > > Thxs!

    >
    >
    >


  6. #6
    Claude
    Guest

    Re: Ungrouping Sheets

    Thanks!

    "Tom Ogilvy" schrieb:

    > Or
    > Activesheet.Select
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    > news:uXkIVHA2FHA.2132@TK2MSFTNGP15.phx.gbl...
    > > Just select any sheet.
    > >
    > > Worksheets(1).Select
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Claude" <Claude@discussions.microsoft.com> wrote in message
    > > news:7574F3A3-118F-4DC7-BA21-B3E25D1589C2@microsoft.com...
    > > > Hi all
    > > > What is the correct syntax to ungroup sheets in a workbook? I want to

    > make
    > > > sure that no sheets have been grouped by a previous user of the files

    > I'm
    > > > opening (as this causes problems with certain VBA procedures I'm running

    > > on
    > > > the files). Can't find anything on this in the VBA help file...
    > > > Thxs!

    > >
    > >

    >
    >
    >


  7. #7
    Registered User
    Join Date
    04-03-2017
    Location
    Auckland, New Zealand
    MS-Off Ver
    2010
    Posts
    12

    Re: Ungrouping Sheets

    Tom Ogilvy never fails! Thanks mate.

    "Or
    Activesheet.Select

    --
    Regards,
    Tom Ogilvy"
    There is always a better way.

  8. #8
    Registered User
    Join Date
    06-24-2013
    Location
    Lisbon
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Ungrouping Sheets

    For the ones like me who avoid 'Active', activate or select properties (like ActiveWindow, ActiveWorkbook, ActiveSheet or Sheets(1).Select) I sugest using Windows(ThisWorkbook.Name) instead of ActiveWindow.

    ' Ungroup Sheets
    If Windows(ThisWorkbook.Name).SelectedSheets.Count > 1 Then
    Windows(ThisWorkbook.Name).SelectedSheets(1).Select
    End If

    you can use this with Workbook_Open() or Workbook_BeforeSave()

    Best regards
    Tiago Simão

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1