VBA-Stuck in loop.

James824

New Member
Joined
Oct 14, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi, so I currently have a loop that fails to stop if the target condition set is impossible to meet.

I have a sheet "system" that is fed by information from "subsystem 1", "subsystem 2", "subsystem 3" and so on (each subsystem sheet is based off the same template). The user can add as many subsystems sheets as they need. Within the subsystem sheets there are components (again can have as many rows required by the user).

I would like to implement the condition that if the sum(I7 to end of row), so a variable range from I7 down to I"", equals zero on any subsystem sheet then the loop ends.

I wonder if anyone would be able to offer any potential ways to implement this? I am new to VBA and I am just trying to get my head around what is going on.

Any help with this would be greatly appreciated.

Many thanks,
J
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I am new to VBA and I am just trying to get my head around what is going on.


Then you might be interested in the contents of this article, in particular the "Debugging" section ...

 
Upvote 0
That's great thanks! I have reviewed this along with a few videos and feel like I have grasped the method for de bugging.

I believe my issue is with the start of the "Do Until" command.

I currently have "Do Until minVal > Target_Reliability" and I believe that I need to add to that.

I think something along the lines of "Do Until minVal > Target_Reliability OR" and then adding in vba language for "the sum of I7 to row end = 0 for any subsystem sheet"

would you happen to know how to write this in VBA?

Many thanks,
J
 
Upvote 0
I understand you already have some code (working or not). Would you like to post it?

PS: please use code tags ...
ScreenShot136.png
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top