vba - internediate step test

pingpong777

New Member
Joined
Apr 6, 2015
Messages
42
hello. i have a macro that is approximately:
___

do

paste values_1

for n = 1 to 6

calculate

paste values_2
paste values_3

next n

___


i would like to put a test between "calculate" and "paste values_2", so that:

___

if the value of a certain cell = 0 Then

stop going through the "for n = 1 to 6" routine and go to the next step after "next n" Else

continue
___

apologies for my sloppy syntax here within my question. can somebody help me with the command to get the routine to skip past the remaining "n" repetitions? do i even need an actual "Else" command, since i want the process to just continue forward when the test is not satisfied?

Thanks for your help.


pingpong777
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Code:
if range("a1").value2 = 0 then exit for
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,103
Messages
6,170,123
Members
452,303
Latest member
c4cstore

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