while/loop

  1. R

    While loop question

    Here is my code: Sub number() Dim x as Integer Do While Cells(x,3) <> 4 Or Cells(x,3).Cells.Offset(0,1) <> 4 x= x + 1 Loop End Sub My data is as follow: C2= 3 D2= 4 C3= 4 C3= 3 C4= 4 D4 = 4 This is a simple example, but I am wondering why "Or" works in the while loop instead of...
  2. L

    do while/loop vs for loop

    Hi I understand both of them but I really do not see when I need to use one over the other. Is there any example that shows we can only use one over the other? Thank you so much.

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