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
277 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
  • 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now