+ Reply to Thread
Results 1 to 3 of 3

Help with Existing Swiss Chess Excel Spreadsheet

  1. #1
    Registered User
    Join Date
    08-07-2020
    Location
    Christchurch, NZ
    MS-Off Ver
    OSX
    Posts
    2

    Help with Existing Swiss Chess Excel Spreadsheet

    Hi everyone,
    I recently found, downloaded and used the Swiss chess tournament found on this site from 2015 (because I am new, I am unable to post the link.

    I started using it and enjoyed how it took all of the work out of organising games that I was doing. Unfortunately, I started running into an error when trying to save a round so that I could generate the next one. Excel popped up with a VBA error labeled: 'Run-time error '1004': Application-defined or object-defined error'. The options on the error box were to end or debug (continue was not an option).

    When I clicked debug it opened up 'supplementary code' in visual basic and took me to a line of code highlighted in yellow (here highlighted by underlining)
    Sub SortStatistics()
    With Sheets("Statistics")
    .Range("F3").Resize(numPlayers, numPlayers + 4).Sort key1:=.Range("G3"), order1:=xlDescending, Header:=xlNo
    End With
    End Sub

    I checked this code against another file I had been using to see if it differed, but it hadn't. Being that I don't know how to programme something like this I naturally came back to ask for help in debugging this.

    Thanks in advance for any help that could be offered.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-10-2012
    Location
    Paris, France
    MS-Off Ver
    2016/365
    Posts
    123

    Lightbulb Re: Help with Existing Swiss Chess Excel Spreadsheet

    Hi MrEDMeaner

    When you call Save_results, the NumPlayers is equal 0, and the function Resize() dont support this

    Maybe change the code this way
    Please Login or Register  to view this content.
    @+
    Last edited by BrianM45; 09-27-2020 at 02:54 AM.
    If you are satisfied with my answer, please add reputation

  3. #3
    Registered User
    Join Date
    08-07-2020
    Location
    Christchurch, NZ
    MS-Off Ver
    OSX
    Posts
    2

    Re: Help with Existing Swiss Chess Excel Spreadsheet

    Hi Brian, thanks for your advice. I am by no means a coder, so I would be grateful for any guidance about where to insert this code. Do I do that in the VBA debug mode?

    EDIT: With a little more effort and thought I realised that I could access the code for this by right clicking the button and editing in the 'assign macro' menu. I copied in your code and it worked, allowing me to save and generate another round. Oddly, it generated the second round again, calling it round one, and didn't add anything to the statistics page, but upon entering the data again, it got it right the second time and generated a new round under the right conditions.

    I will add your code to the original copy of the file I have, and hopefully it will get it right from the start next time I create a new tournament.

    Thanks for your help.
    Attached Images Attached Images
    Last edited by MrEDMeaner; 09-27-2020 at 03:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Swiss Pairing algorithm in excel to organize a chess tournament
    By muhendisOE in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-07-2022, 11:24 AM
  2. Excel and Chess. does anyone know how to use excel for chess?
    By charlesgalofre in forum The Water Cooler
    Replies: 2
    Last Post: 11-23-2019, 11:47 AM
  3. [SOLVED] Chess player prediction Excel Help
    By JSH2017 in forum Excel General
    Replies: 2
    Last Post: 01-21-2018, 09:19 PM
  4. How can i run an existing excel vba on a new spreadsheet automatically?
    By songhaegyo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2017, 09:37 AM
  5. Swiss Pairing algorithm in excel to organize a backgammon tournament
    By JohnHedge in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2016, 01:44 AM
  6. [SOLVED] How to convert the Swiss franc to excel readable number
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-27-2015, 09:18 PM
  7. Replies: 1
    Last Post: 10-04-2012, 09:26 PM

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