Solved

Chart Enhancement with Macro Change

Posted on 2011-09-22
5
332 Views
Last Modified: 2012-05-12
EE Professionals,

I have a Chart that EE helped me create that needs an enhancement.  Presently if you add a Task and assign it a number in the Critical Path, it will adjust the data but not the chart.  It's also difficult to add tasks because the data is in line with the chart for part of it.  

Can the "Update" macro be made automatic?  So that when there is a change to the data and the "Enter" key is pressed, the table is automatically updated?

B.
RASCI-Sheetv3.xlsm
0
Comment
Question by:Bright01
  • 3
  • 2
5 Comments
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 36579793
Hello Bright,

You can combine the Worksheet_Change event and the macro that updates the RACI table.

Right-click on the sheet tab, click View Code to open the VB Editor
Double-click "Sheet1 (RASCI)" in the Navigation pane of the VBE
Scroll down to the end of the Worksheet_Change procedure and before the "End Sub" line enter

    PopulateRasciTable

The last four lines of the code should now read

        End If
    End With
    PopulateRasciTable
End Sub

Open in new window


Now, whenever you add a row of data to the text table, as soon as you enter a number in column A, the row will be sorted into the data table, and an entry for that row value will be created in the RASCI chart. Whenever you edit the number, description or RASCI letter for a row, it will be reflected in the RASCI table.

cheers, teylyn
0
 

Author Comment

by:Bright01
ID: 36579986
Teylyn,

Thank you for  the quick response.  It works great!  Is there a way where the cursor won't revert back to the top?   Thank you,

B.
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst earned 500 total points
ID: 36580083
In the Worksheet_Change event of the RASCI sheet, add this line before End Sub


    Target.Select

The last few lines of the code should read:

            With Application
                .EnableEvents = True
                .ScreenUpdating = True
            End With
        End If
    End With
    PopulateRasciTable
    Target.Select
End Sub

Open in new window


The cursor will stay on the same row as it was in when the new data was entered.

Due to the macro that sorts the table by the number in column A upon each change, I don't see an easy way to move the active cell to the row where the data lives after the table has been sorted.

To reduce the screen flickering, you could add

Application.ScreenUpdating = False

at the start of the procedure ...

Private Sub Worksheet_Change(ByVal Target As Range)
    
Application.ScreenUpdating = False

    Dim LastR As Long

Open in new window


... and

    Application.ScreenUpdating = True

before the sub ends

            With Application
                .EnableEvents = True
                .ScreenUpdating = True
            End With
        End If
    End With
    PopulateRasciTable
    Target.Select
    Application.ScreenUpdating = True
End Sub

Open in new window


0
 

Author Closing Comment

by:Bright01
ID: 36580174
Teylyn!  Great job.  Thank you very much.  I will most likely be asking a related question on this as this function continues to be built out. And I thought you said you were a formulas person!

Cheers,

B.
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 36580246
Yeah, well, stretching and all :-)

Thanks for the grade.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
This collection of functions covers all the normal rounding methods of just about any numeric value.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

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