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.
Bookmarks