+ Reply to Thread
Results 1 to 5 of 5

Need help: Macro or multi-step formula needed in place of a pivot-table method.

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Office 365
    Posts
    4

    Lightbulb Need help: Macro or multi-step formula needed in place of a pivot-table method.

    edit: it might be the case that it can be solved with a vlookup, but I thought I'd try here first!

    I have a small challenge for you all! I work for a museum and am thus tasked with producing Performance figures. The guy before me has set up a system that works well, but is very long-winded, so I'm hoping to simplify it.

    The current system: Every month I'm sent learner figures by 12 venues in the county. These are pasted into 'area' spreadsheets (e.g. Newcastle, Sunderland...), which have workbook tabs 'by venue'. There is then a pivot table that works out figures by: Month, Age, 'BVPI' (whether it was a school or not) and 'onsite/offsite'. These final figures are then posted into THREE seperate spreadsheets: Learners by venue (BVPI), All learners (both BVPI & non-BVPI) & non-BVPI. I have noticed in the final figures that age is not mentioned, so I am leaving it out for now.

    This takes quite a long time and there is a lot of room for human error.

    My solution:

    Paste the figures into the 'Area' spreadsheets as normal. Have a VB code or macro that does the following:

    1. Only looks at figures for the current month (the date is shown as 2013_2 for February for example).
    2. Looks at the BVPI column (which says 'Valid' or '0')
    3. If the value is 'valid' then add up the number of visitors in that row (columns D to M, for example)
    4. I must also know which figures are 'onsite' and which are 'offisite', which is displayed in column X

    It would also be cool to have:
    5. Sum of all 'valid' visitor figures for February.
    6. From which I (or Excel) can subtract 'valid' figures from 'total' figures to give the 'non-valid' number of visitors (non-BVPI)
    (From this, I can have a simple =sum() formula that works out 'total engagements')

    Phew. See what I mean? I know what I want to do, but I don't know where to begin. I haven't written VB for almost 10 years; I'm not even sure if it's the right method.

    Please advise! I can supply examples of the spreadsheet if needed.
    Last edited by katiedegu; 03-21-2013 at 11:52 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Bit of a complicated one - need help writing macro/VBA to complete a number of tasks

    for 1, you could add an extra page field in your pivot, for the date, and set this by VB to be Year(now()) & "_" & month(now())

    The rest is all possible, can you attach a demo file to look at?

  3. #3
    Registered User
    Join Date
    03-21-2013
    Location
    Newcastle upon Tyne
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Bit of a complicated one - need help writing macro/VBA to complete a number of tasks

    Have the demo file... how would I attach it? Like a screenshot?

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Bit of a complicated one - need help writing macro/VBA to complete a number of tasks

    No, click "Go Advanced" and then you can add attachments.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Bit of a complicated one - need help writing macro/VBA to complete a number of tasks

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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