Solved

Chart Enhancement with Macro Change

Posted on 2011-09-22
5
334 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

816 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

10 Experts available now in Live!

Get 1:1 Help Now