+ Reply to Thread
Results 1 to 4 of 4

[Solved] Help creating a Summary Page from user-defined worksheets

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    37

    [Solved] Help creating a Summary Page from user-defined worksheets

    I have the following code that adds all of the values of column BD (cells BD8:BD100) from various worksheets (user defined) and totals the results onto a Summary page column C (cells C8:C100).

    Please Login or Register  to view this content.
    The problem occurs when Sheet(4) doesn't exist.
    A Run-time error '9': Subscript out of range error results when the user attempts to run a summary report from the Summary tab when no Sheet4 exists. The following line of code is highlighted in yellow: ws2 = Sheets(4).Name

    Is there a way to rewrite the code so that a message box appears directing the user to create a worksheet from the location tab and enter the respective quantities if a location worksheet "Sheet(4)" hasn't been created or possibly check to see if "Sheet (4)" exists and if it doesn't direct the user to create a worksheet from the location tab?

    I hope I'm making sense or that the attached file better illustrates what I'm attempting.
    Thanks in advance for any assistance provided.
    Attached Files Attached Files
    Last edited by gophil1; 08-17-2012 at 12:59 PM. Reason: Solution found

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help creating a Summary Page from user-defined worksheets

    Hi

    Bit brutal but hopefully you will get what I mean.

    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    37

    Re: Help creating a Summary Page from user-defined worksheets

    Thanks for the help, but for some reason the code isn't generating a summary page total now.
    The extra bit of code that you added seems pretty straight forward and I'm at a loss as to why it doesn't work.

  4. #4
    Registered User
    Join Date
    07-25-2012
    Location
    CT
    MS-Off Ver
    Excel 2016
    Posts
    37

    Re: Help creating a Summary Page from user-defined worksheets

    I think I may have spoke too soon. It looks like the Summary tab always has to be the third tab in the workbook in order for the coding to work properly.
    I'm marking this as "Solved".
    Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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