+ Reply to Thread
Results 1 to 19 of 19

Trying to create a summary page

  1. #1
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Trying to create a summary page

    Hello all.

    I work in a theme park and I have a spreadsheet that has status of effects broken down by area. Each page is a seperate area. Column B on every page lists the effect status (Either OOS, or In Service).

    I would like to add a summary page that will search the rest of the pages and any which column B has 'OOS' in it, add the whole line to the list on the summary page (So I can have a summary of all effects that are out of service).

    Is there an easy way to do this?

    Any help appreciated.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Trying to create a summary page

    That will take a macro but you will have to post a sample workbook.
    Ben Van Johnson

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    Hi XAOS,

    Try on a copy of your workbook:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    Correction - try this rather than the first posting:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    Awesome I will try this when I get to work tomorrow. Can I set it up to auto-run as soon as I open the workbook?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Trying to create a summary page

    In a standard moduke

    Please Login or Register  to view this content.
    In the workbook open event

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    As Roy says:

    Private Sub Workbook_Open()
    OOS
    End Sub

  8. #8
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    Quote Originally Posted by xladept View Post
    Correction - try this rather than the first posting:

    Please Login or Register  to view this content.
    This worked, but gives me a run-time error '9': subscript out of range.

    When I debug it highlights this line:

    Set WS = Worksheets(j)

    Also how Do I clear the old data before it runs? I noticed it keeps adding the lines each time I open the workbook.

    One more minor thing, I have conditional formatting set on the other worksheets. Is there a way to force it not to copy the fill color when it copies over to the summary page?

    Thank you very much for taking the time to help me out. You have no idea how much time this will save and increase productivity.

    --edit-- I should have reported that I am using excel 2003 SP3 at work if that helps.
    Last edited by Xaos; 07-09-2012 at 05:35 PM.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    I'll look at the index and let you know. Is the summary the last sheet???
    Last edited by xladept; 07-09-2012 at 06:30 PM.

  10. #10
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    I was about to say yes it is the last sheet (as displayed in tab order), but looking in the VBA editor, it was not. It is a moot point, however, because I switched it to be the last sheet and it still caused the same error.

    --edit-- I commented out this part:

    If Worksheets(j).Name = "Summary" Then j = j + 1


    and the error went away and the script functioned except that it added all the lines twice for some reason.
    Last edited by Xaos; 07-09-2012 at 07:40 PM.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    Hi Xaos,

    Try this version:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    Hi Xladept

    This code appeared to do nothing at all. I can e-mail you a copy of my workbook if you like, but I can't post it publicly due to confidentiality of my workplace.

    There are 7 worksheets with Summary being the last (sheet 7).

    This is what I currently have on the "This workbook" page of VBA editor:
    Please Login or Register  to view this content.


    --Edit--

    I went ahead and built a dummy workbook just to give you an idea of how it is setup.TestbookA.xls
    Last edited by Xaos; 07-10-2012 at 03:33 PM.

  13. #13
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    OK I figured out what the problem was. I had the first 3 rows merged with a title on each page. The script you provided worked on my test workbook. The only odd thing now is that the title row (row 1) from sheet 6 is being copied over to the summary page. Other than that it is working perfectly.

    --edit-- figured out how to fix.

    I commented out this line:

    Worksheets(Worksheets.Count - 1).Cells(1, 1).EntireRow.Copy Summary.Cells(1, 1)

    and added Summary.Cells(1,1) = "Summary"
    Last edited by Xaos; 07-10-2012 at 06:18 PM.

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    Hi Xaos,

    Great going- I thought that there would be header rows. Sorry about that. (They say a mathematician will assume anything but responsibility.)

    Make that be:

    Please Login or Register  to view this content.
    Last edited by xladept; 07-10-2012 at 07:29 PM.

  15. #15
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    Thanks for all your help. Much appreciated. Added and modified a few things, but here's my current code version:

    Please Login or Register  to view this content.
    The autofit stuff doesn't seem to work, but ill figure that out through online searching.

    Thanks again.
    Last edited by Xaos; 07-11-2012 at 03:07 PM.

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    I thought we were finished - what more do you need?

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    The autofit needs to be run after the sheet is populated - so if you move it to the end it should work!

  18. #18
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Trying to create a summary page

    Yeah nothing more needed. Thanks a lot for all your help. I've actually learned a lot from disecting your code. Appreciate it.

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to create a summary page

    You're welcome!

+ 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