+ Reply to Thread
Results 1 to 3 of 3

Procedure too large, can be more efficient?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Hampshire, England
    MS-Off Ver
    Excel 2007
    Posts
    71

    Procedure too large, can be more efficient?

    Simplifying the code to an extreme

    Private Sub CommandButton1_Click()
    
    Code
    
    Do while
    
         Code
    
                If ... then
    
                                   CHARTS
    
                End if
    
                                    CHARTS
    
    loop
    
    Code
    
    End sub

    Within the "IF...THEN" loop I activate a graph and specify the source. I am doing this for multiple charts.

    I also have to do the same in the code immediately after the "if..then" loop.



        ActiveSheet.ChartObjects("CB_C").Activate
        ActiveChart.PlotArea.Select
        ActiveChart.SetSourceData Source:=Sheets("Your Consortia for this quarter").Range("D2:D16,AU2:AU16"), PlotBy:=xlColumns
    The first part of the source does not change, the second part does.

    Any suggestions on how I can make it more efficient or break down the procedure so it can be run?

    Thanks

  2. #2
    Registered User
    Join Date
    02-23-2011
    Location
    Hampshire, England
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Procedure too large, can be more efficient?

    I've solved it. I would delete the post but I don't know how to.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Procedure too large, can be more efficient?

    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1