+ Reply to Thread
Results 1 to 5 of 5

Consolidating Code

  1. #1
    Registered User
    Join Date
    08-09-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Consolidating Code

    Hello,

    I run a NFL pool with a bunch of my friends from a spreadsheet. I use it as a tool to help me learn new tricks and methods in excel (learning is so much more fun when its not what you get paid to do).

    Anyway two years ago I started using a Macro for the scoring and I was hoping to simplify the code. Essentially its a matrix and the macro just compares what is populated in the field where they make their pick to a field that is populated with the winner of the game, then makes the appropriate changes. As I was/am new at this I went the brute force method. The core of the code is below:

    Please Login or Register  to view this content.

    (more of this ad nauseam)

    The 'setting' piece repeats 192 times per week (16 games * 12 players) and I have a different macro for each week. As you can imagine this makes for a very long string of code. Due to the repetitive nature I am assuming that there must be another way to do this but Google has failed to provide me much help.

    Any help would be greatly appreciated.

    Thank you,
    Nik
    Last edited by NRZ; 08-09-2010 at 04:05 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Consolidating Code

    Maybe something like:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  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: Consolidating Code

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-09-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Consolidating Code

    sorry about that. I have updated the post.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Consolidating Code

    Please Login or Register  to view this content.
    Last edited by snb; 08-09-2010 at 04:55 PM.

+ 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