Results 1 to 3 of 3

Code to sum cell values using a loop method

Threaded View

  1. #1
    Registered User
    Join Date
    04-14-2012
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Code to sum cell values using a loop method

    Hi,

    I want to write a code but I get a lot of errors as I am not really familiar with syntax

    I wonder if someone can convert the following:

    sub myloop()
    
    Dim x
    Dim y
    Dim Total
    Dim Count
    
    count = 1
    total = 0
    
    Do until Cells(count,0) = ""
    
    x = cells(count,0)
    y = cells(count + 1, 0)
    
    
    if x = y then
    Total = total + cell(count,3)
    count = count + 1
    
    else
    
    total = total + cell(count,2)
    cell(count,10) = total
    count = count + 1
    total = 0
    
    
    Loop
    
    End sub
    Last edited by qussai; 07-10-2012 at 08:55 AM. Reason: This post needed code tags.

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