?
Solved

How do I build VBA in Excel to edit muiltiple sheets in a workbook and then produce a graph for each sheet?

Posted on 2011-02-16
3
Medium Priority
?
311 Views
Last Modified: 2013-11-05
The attached worksheet has master sheet called (Incremental EEI), which contains 31 days of data.  I've segregated the data by date on seperate sheets.  Sheet2 I edit ed the array to include only hourly increments, and created graph.  I have to perform this same on each of the 32 sheets within the workbook.  I'll have to this for each month.  Can VBA or macro solution be delevloped to accomplish this routine tasking?  If so, how? FANG-DEC-2010-Breakdown.xlsx
0
Comment
Question by:Curt_Hasan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:jkpieterse
ID: 34906734
I'd suggest to use just one report sheet, which uses formulas to extract the right information from your data to show the chart, see attached.
FANG-DEC-2010-BreakdownJKP.xlsx
0
 

Author Comment

by:Curt_Hasan
ID: 34906888
Your solution can possibly work.  However, how would you apply this solution to graphing each days data?
0
 
LVL 11

Accepted Solution

by:
jkpieterse earned 2000 total points
ID: 34907587
Not sure what you mean? Creating a printout of each day? That requires a tiny macro, such as:

Option Explicit

Sub PrintThisMonth()
    Dim lCt As Long
    Dim lDaysInMonth As Long
    Dim dDate As Date
    dDate = InputBox("Please enter a date in the month you want to report", , Format(Date, "yyyy/mm/dd"))
    lDaysInMonth = DateSerial(Year(dDate), Month(dDate) + 1, 0) - DateSerial(Year(dDate), Month(dDate), 1)
    For lCt = DateSerial(Year(dDate), Month(dDate), 1) To DateSerial(Year(dDate), Month(dDate), 1) + lCt
        With Worksheets("Sheet2")
            .Range("B3").Value = lCt
            .PrintOut preview:=True
        End With
    Next
End Sub
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question