+ Reply to Thread
Results 1 to 3 of 3

How to create a button that runs a sumproduct function and lets me choose a date range

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Waycross, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question How to create a button that runs a sumproduct function and lets me choose a date range

    I am a total newb at working with buttons and VBA code but I want to learn. The attached workbook has a sheet called Trending whose many cells make reference to another sheet called WOPM Completion Detail. Ultimately, I want to create a button that serves the same purpose as the function in say, cell C3 on the Trending sheet, but I want to be able to choose the date range. If I could create ONE button instead of having a whole sheet which constantly updates I could place it anywhere. As it stands now, the charts are fine as they update as they should, but I have been building on this project more like a quilt and less like a programmer. If there is a way to create some sort of dashboard where I could prompt the user to enter what report they want that would be superb. The WOPM Completion Detail sheet also has some VBA code behind it that I found on the internet a while back called FunctionMathByColor. I did not write the code, nor do I understand it very well, but I was able to incorporate it into my spreadsheet to countif by color--very helpful as you can see if you examine the spreadsheets. As far as writing the code behind the button I'd like (button can be seen on the Trending sheet (and it clearly doesn't work because I have only partial code there) this is my start:

    Sub WY_Trend_Feb_2012()
    MsgBox WorksheetFunction.SumProduct(WOPM Completion Detail.(H4:H919="Woodyard"))
    End Sub

    I wanted to basically paste the sumproduct code after worksheet function but realized I would have no way to prompt myself for a date range, an area (Woodyard, Dryers, Pelletizing) or a Department. Then, I realized I had no clue how to turn that simple return value into a report so perhaps I am just better off keeping the sheet the way it is.

    At any rate, if someone has advice or can point me in the right direction with this I am happy to work hard to learn coding and buttons since I have come this far anyway. Thank you for any help or input you can provide.
    Last edited by jkadas; 06-08-2012 at 07:38 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: How to create a button that runs a sumproduct function and lets me choose a date range

    where is the attached file. have I missed it?
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Waycross, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to create a button that runs a sumproduct function and lets me choose a date range

    File is again attached. I think nobody viewed it and so it dropped off after an hour or so. Thanks for looking.

+ 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