+ Reply to Thread
Results 1 to 5 of 5

Help: formula or VB code to implement voting system code

Hybrid View

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    3

    Help: formula or VB code to implement voting system code

    Hi,

    I would like to write a formula or a VB-code to count the number of times that, e.g. team B vote "con" in proposals presented/writen by team A, but I can't. For this example, i tried this code in a VB module :
    Sub count_votes()
    lin = 2
    col = 2
    p = 0
    
    Do While Cells(lin, 2) <> ""
    If Cells(lin, 4) = "con" Then
        p = p + 1 And lin = lin + 1
    Else
        lin = lin + 1
    End If
    Loop
    Cells(4, 17) = p
    
    End Sub
    Of course, that I would like to implement the same system to all teams.

    Please see the attachment.

    Thanks for your help in advance.
    Attached Files Attached Files
    Last edited by cdsc; 04-22-2013 at 10:01 AM.

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help: formula or VB code to implement voting system code

    Anyone, please?

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,696

    Re: Help: formula or VB code to implement voting system code

    Pl see the attached file.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-22-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Help: formula or VB code to implement voting system code

    Thank you very much kvsrinivasamurthy , but is there a possibility to improve the velocity of the calculations (improve the code), because I want to implement more than 5 rows (proposals)? Thanks, once again.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,696

    Re: Help: formula or VB code to implement voting system code

    I don't know other way.But sumproduct formula works fast even for thousands of rows.

+ 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