Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default returning back to loop check condition without completing the loop

Hi All,

I apologise if this question has been posted before but to be true, I
could not find it.

I have a very little question. Please see below

Do While some_condition = TRUE

'-----Some Code----

If this_condition = TRUE then

' Here I would like to send the execution back to "Do
While some_condition = TRUE"
' and bypass all succeeding lines of code

End If

'-----Some Code----

loop

Kindly let me know if this is supported / possible in VBA.

Regards

Ashish
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default returning back to loop check condition without completing the loop

Do While some_condition = TRUE

'-----Some Code----

If this_condition = TRUE then
'do nothing
else
'some code here
End If

'no code here!!!!
loop

ashish128 wrote:

Hi All,

I apologise if this question has been posted before but to be true, I
could not find it.

I have a very little question. Please see below

Do While some_condition = TRUE

'-----Some Code----

If this_condition = TRUE then

' Here I would like to send the execution back to "Do
While some_condition = TRUE"
' and bypass all succeeding lines of code

End If

'-----Some Code----

loop

Kindly let me know if this is supported / possible in VBA.

Regards

Ashish


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default returning back to loop check condition without completing theloop

On Mar 18, 8:30*pm, Dave Peterson wrote:
Do While some_condition = TRUE

* * * '-----Some Code----

* * * *If this_condition = TRUE then
* * * * * *'do nothing
* * * *else
* * * * * *'some code here
* * * *End If

* * * *'no code here!!!!
loop





ashish128 wrote:

Hi All,


I apologise if this question has been posted before but to be true, I
could not find it.


I have a very little question. Please see below


Do While some_condition = TRUE


* * * '-----Some Code----


* * * *If this_condition = TRUE then


* * * * * * * ' Here I would like to send the execution back to "Do
While some_condition = TRUE"
* * * * * * * ' and bypass all succeeding lines of code


* * * *End If


* * * '-----Some Code----


loop


Kindly let me know if this is supported / possible in VBA.


Regards


Ashish


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Hi Dave,

I know this will work but I cannot do this. I just want to stop
execution and return it to loop checking condition.
Besides this, I need to apply this at several places in my loop.

Thanks for your help
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default returning back to loop check condition without completing theloop

On Mar 18, 8:30*pm, Dave Peterson wrote:
Do While some_condition = TRUE

* * * '-----Some Code----

* * * *If this_condition = TRUE then
* * * * * *'do nothing
* * * *else
* * * * * *'some code here
* * * *End If

* * * *'no code here!!!!
loop





ashish128 wrote:

Hi All,


I apologise if this question has been posted before but to be true, I
could not find it.


I have a very little question. Please see below


Do While some_condition = TRUE


* * * '-----Some Code----


* * * *If this_condition = TRUE then


* * * * * * * ' Here I would like to send the execution back to "Do
While some_condition = TRUE"
* * * * * * * ' and bypass all succeeding lines of code


* * * *End If


* * * '-----Some Code----


loop


Kindly let me know if this is supported / possible in VBA.


Regards


Ashish


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dear Dave,

My question is to break the process flow in middle of a loop and
restart it from the loop condition checking.

Regards
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default returning back to loop check condition without completing the loop

You didn't like Rick's reply?

ashish128 wrote:

On Mar 18, 8:30 pm, Dave Peterson wrote:
Do While some_condition = TRUE

'-----Some Code----

If this_condition = TRUE then
'do nothing
else
'some code here
End If

'no code here!!!!
loop





ashish128 wrote:

Hi All,


I apologise if this question has been posted before but to be true, I
could not find it.


I have a very little question. Please see below


Do While some_condition = TRUE


'-----Some Code----


If this_condition = TRUE then


' Here I would like to send the execution back to "Do
While some_condition = TRUE"
' and bypass all succeeding lines of code


End If


'-----Some Code----


loop


Kindly let me know if this is supported / possible in VBA.


Regards


Ashish


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dear Dave,

My question is to break the process flow in middle of a loop and
restart it from the loop condition checking.

Regards


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default returning back to loop check condition without completing theloop

On Mar 24, 5:35*pm, Dave Peterson wrote:
You didn't like Rick's reply?





ashish128 wrote:

On Mar 18, 8:30 pm, Dave Peterson wrote:
Do While some_condition = TRUE


* * * '-----Some Code----


* * * *If this_condition = TRUE then
* * * * * *'do nothing
* * * *else
* * * * * *'some code here
* * * *End If


* * * *'no code here!!!!
loop


ashish128 wrote:


Hi All,


I apologise if this question has been posted before but to be true, I
could not find it.


I have a very little question. Please see below


Do While some_condition = TRUE


* * * '-----Some Code----


* * * *If this_condition = TRUE then


* * * * * * * ' Here I would like to send the execution back to "Do
While some_condition = TRUE"
* * * * * * * ' and bypass all succeeding lines of code


* * * *End If


* * * '-----Some Code----


loop


Kindly let me know if this is supported / possible in VBA.


Regards


Ashish


--


Dave Peterson- Hide quoted text -


- Show quoted text -


Dear Dave,


My question is to break the process flow in middle of a loop and
restart it from the loop condition checking.


Regards


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dear Dave,

I must say that there is some problem with the GUI.

My post says 6 messages but I cannot view more than 4 (two mine and
two of yours)

Therefore I dont even know if Rick has suggested some solution.

Please convey my apologies to Rick (If you can) as I cannot see a
single post of his.

Thank You.

Regards
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default returning back to loop check condition without completing the loop

Hoping that you will be able to see this response from me, here is what I
posted originally...

You could use a Label Statement and a GoTo statement like this...

Do While some_condition = TRUE
'-----Some Code----
If this_condition = TRUE then GoTo Continue
'-----Some Code----
Continue:
Loop

Please indicate if you can see this message.

If Ashish doesn't respond in a reasonable time period, will someone be kind
enough to copy and post it back to Ashish for me.

Rick



"ashish128" wrote in message
...
On Mar 24, 5:35 pm, Dave Peterson wrote:
You didn't like Rick's reply?





ashish128 wrote:

On Mar 18, 8:30 pm, Dave Peterson wrote:
Do While some_condition = TRUE


'-----Some Code----


If this_condition = TRUE then
'do nothing
else
'some code here
End If


'no code here!!!!
loop


ashish128 wrote:


Hi All,


I apologise if this question has been posted before but to be true,
I
could not find it.


I have a very little question. Please see below


Do While some_condition = TRUE


'-----Some Code----


If this_condition = TRUE then


' Here I would like to send the execution back to "Do
While some_condition = TRUE"
' and bypass all succeeding lines of code


End If


'-----Some Code----


loop


Kindly let me know if this is supported / possible in VBA.


Regards


Ashish


--


Dave Peterson- Hide quoted text -


- Show quoted text -


Dear Dave,


My question is to break the process flow in middle of a loop and
restart it from the loop condition checking.


Regards


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dear Dave,

I must say that there is some problem with the GUI.

My post says 6 messages but I cannot view more than 4 (two mine and
two of yours)

Therefore I dont even know if Rick has suggested some solution.

Please convey my apologies to Rick (If you can) as I cannot see a
single post of his.

Thank You.

Regards

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default returning back to loop check condition without completing the loop

You could use a Label Statement and a GoTo statement like this...

Do While some_condition = TRUE
'-----Some Code----
If this_condition = TRUE then GoTo Continue
'-----Some Code----
Continue:
Loop


Rick


"ashish128" wrote in message
...
Hi All,

I apologise if this question has been posted before but to be true, I
could not find it.

I have a very little question. Please see below

Do While some_condition = TRUE

'-----Some Code----

If this_condition = TRUE then

' Here I would like to send the execution back to "Do
While some_condition = TRUE"
' and bypass all succeeding lines of code

End If

'-----Some Code----

loop

Kindly let me know if this is supported / possible in VBA.

Regards

Ashish


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
Add a second condition to loop Casey[_112_] Excel Programming 5 July 6th 06 11:59 PM
Loop or condition? To check down the rows KH_GS Excel Programming 4 March 29th 06 09:42 AM
Using For loop to condition bundyloco[_6_] Excel Programming 1 August 19th 05 07:25 PM
two-condition loop Jamie Martin[_2_] Excel Programming 0 October 6th 03 11:47 PM


All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"