Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8280383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:39:26+00:00 2026-06-08T09:39:26+00:00

This program creates a table of numbers, and then attempts to sum it up,

  • 0

This program creates a table of numbers, and then attempts to sum it up, row by row. I’m using IsBlank() to test if the topmost cell is blank. If it is blank, it should end the loop, but if it isn’t, the loop should keep going. However, it keeps ending after the first time through the loop. Why is that?

I have a feeling it’s really obvious.

Edit: I should note that the whole “counter” thing is in there because I was going to start playing around with that if this worked. And it didn’t work, so I’m here!

Option Explicit
Dim Counter As Long
Dim i As Long
Dim col As Long
Dim row As Long

Sub SumRange()
    For col = 1 To 8
        For row = 1 To 6
            Cells(row, col) = Rnd
        Next row
    Next col
    Counter = 6
    For i = 1 To 9
        If IsEmpty(Cells(1, i)) = False Then
            Cells(Counter + 1, i) = Application.WorksheetFunction.Sum(Range(Cells(1, i), Cells(Counter, i)))
        Else
            End If
        End
    Next
    MsgBox Cells(4, 5)
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:39:27+00:00Added an answer on June 8, 2026 at 9:39 am

    There are two problems:

    1. The End statement is incorrect. If I remember correctly, End means to end the program. You have to explicitly state what you are ending (End If, End With, …). In this case you mean End If.

    2. You need to use Exit For to jump out of the for loop. I think you mean it to be where your current End If statement is.

    I’m not sure what you’re trying to do, but you can also consider using a while loop with the condition While Not IsEmpty(Cells(1, i)) and then increment the counter i from within the loop. To me this feels a little better than a for loop with a jump in it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running a program that creates a table and then inserts some data. This
I have made a program that scans rss feeds. This same program creates feeds
use this website a lot but first time posting. My program creates a number
I created this program: #include <iostream> #include <fstream> using namespace std; int main ()
I have created this simple program to learn shared_ptr using namespace std; #define Yes
How do I access the current table in Numbers using py-appscript ? For posterity,
I am trying to run a large script that creates a table, and then
I bought this program that created a pretty nice imageuploader flash script however I
I've created this simple example program, but this doesn't work. it won't connect. any
I created a setuid program in C. The executable looks like this: -r-s-r-s--- 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.