+ Reply to Thread
Results 1 to 5 of 5

Activating sheets with same name in multiple workbooks

  1. #1
    Barb Reinhardt
    Guest

    Activating sheets with same name in multiple workbooks

    I have about 20 workbooks and within these workbooks are about 35 sheets with
    identical sheet names. I'd like to review the sheets with the same name
    rapidly without having to click through the workbooks.

    Any suggestions?

    Thanks in advance,
    Barb Reinhardt

  2. #2
    Bob Phillips
    Guest

    Re: Activating sheets with same name in multiple workbooks

    Impossible, the name is unique within a workbook. 35 into 20 doesn't go.

    What do you men by review?

    --
    HTH

    Bob Phillips

    "Barb Reinhardt" <[email protected]> wrote in message
    news:[email protected]...
    > I have about 20 workbooks and within these workbooks are about 35 sheets

    with
    > identical sheet names. I'd like to review the sheets with the same name
    > rapidly without having to click through the workbooks.
    >
    > Any suggestions?
    >
    > Thanks in advance,
    > Barb Reinhardt




  3. #3
    Tom Ogilvy
    Guest

    Re: Activating sheets with same name in multiple workbooks

    Dim rng as Range, bk as Workbook
    for each bk in Application.Workbooks
    bk.Activate
    worksheets("ABC").Activate
    On error resume Next
    set rng = Application.Inputbox("Click Cancel to continue", type:=8)
    On error goto 0
    Next

    --
    Regards,
    Tom Ogilvy

    "Barb Reinhardt" <[email protected]> wrote in message
    news:[email protected]...
    > I have about 20 workbooks and within these workbooks are about 35 sheets

    with
    > identical sheet names. I'd like to review the sheets with the same name
    > rapidly without having to click through the workbooks.
    >
    > Any suggestions?
    >
    > Thanks in advance,
    > Barb Reinhardt




  4. #4
    Barb Reinhardt
    Guest

    Re: Activating sheets with same name in multiple workbooks

    How do I identify the workbooks that I'm using and the specific sheet names?
    As you can clearly see, I'm a novice at this. If you could direct me to
    something I could read on this, I'd greatly appreciate it.

    Regards,
    Barb Reinhardt

    "Tom Ogilvy" wrote:

    > Dim rng as Range, bk as Workbook
    > for each bk in Application.Workbooks
    > bk.Activate
    > worksheets("ABC").Activate
    > On error resume Next
    > set rng = Application.Inputbox("Click Cancel to continue", type:=8)
    > On error goto 0
    > Next
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Barb Reinhardt" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have about 20 workbooks and within these workbooks are about 35 sheets

    > with
    > > identical sheet names. I'd like to review the sheets with the same name
    > > rapidly without having to click through the workbooks.
    > >
    > > Any suggestions?
    > >
    > > Thanks in advance,
    > > Barb Reinhardt

    >
    >
    >


  5. #5
    Tom Ogilvy
    Guest

    Re: Activating sheets with same name in multiple workbooks

    Well, you left your description vague. If you want to loop through 20
    workbooks for 35 sheets - how you would identify them is pretty much up to
    you. for example, if you had all the workbooks and only those workbooks in
    a single directory (C:\Mypath for example) and they were not open in Excel

    Sub ABCD()
    Dim v(1 to 20) as String
    Dim v1(1 to 35)
    Dim i as Long, sPath as String, sName as String
    Dim sh as worksheet, j as Long
    sPath = "C:\Mypath\"
    sName = Dir(sPath & "*.xls")
    i = 0
    do while sName <> ""
    i = i + 1
    set bk = Workbooks.Open(sPath & sName)
    v(i) = bk.Name
    sName = Dir()
    Loop
    i = 0
    for each sh in workbooks(v(1)).Worksheets
    i = i + 1
    v1(i) = sh.Name
    Next sh
    for i = 1 to 35
    for j = 1 to 20
    set bk = Workbooks(v(j))
    bk.Activate
    worksheets(v1(i)).Activate
    On error resume Next
    set rng = Application.Inputbox("Click Cancel to continue", type:=8)
    On error goto 0
    Next j
    Next i
    for i = 1 to 20
    workbooks(v(i)).Close SaveChanges:=False
    Next
    End Sub

    --
    Regards,
    Tom Ogilvy



    "Barb Reinhardt" <[email protected]> wrote in message
    news:[email protected]...
    > How do I identify the workbooks that I'm using and the specific sheet

    names?
    > As you can clearly see, I'm a novice at this. If you could direct me to
    > something I could read on this, I'd greatly appreciate it.
    >
    > Regards,
    > Barb Reinhardt
    >
    > "Tom Ogilvy" wrote:
    >
    > > Dim rng as Range, bk as Workbook
    > > for each bk in Application.Workbooks
    > > bk.Activate
    > > worksheets("ABC").Activate
    > > On error resume Next
    > > set rng = Application.Inputbox("Click Cancel to continue", type:=8)
    > > On error goto 0
    > > Next
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Barb Reinhardt" <[email protected]> wrote in

    message
    > > news:[email protected]...
    > > > I have about 20 workbooks and within these workbooks are about 35

    sheets
    > > with
    > > > identical sheet names. I'd like to review the sheets with the same

    name
    > > > rapidly without having to click through the workbooks.
    > > >
    > > > Any suggestions?
    > > >
    > > > Thanks in advance,
    > > > Barb Reinhardt

    > >
    > >
    > >




+ 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