#1   Report Post  
Posted to microsoft.public.excel.misc
Jeff
 
Posts: n/a
Default VBA go to line

Hi,

I have some code and a while loop. I want to go to the line where the text
"L1" is in the code. "L1" is right before the while loop. and I want to go
to the "L1" based on the result of an if statement.

I was looking for a "Go to" function in my VBA manual, but I could not find
anything.

Is there a Go to function that can help me?

Thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default VBA go to line

Sub TryNow()
Dim Test As Boolean
Dim This As Integer
Dim That As Integer

This = 1
That = 1

Test = MsgBox("Continue?", vbYesNo) = vbYes

If Test = True Then GoTo L1
Exit Sub

L1:
While This = That
MsgBox "I'm in the loop"
This = InputBox("Give me a number: 1 to continue, other to stop")
Wend

MsgBox "I've stopped"

End Sub

HTH,
Bernie
MS Excel MVP


"Jeff" wrote in message
...
Hi,

I have some code and a while loop. I want to go to the line where the text
"L1" is in the code. "L1" is right before the while loop. and I want to go
to the "L1" based on the result of an if statement.

I was looking for a "Go to" function in my VBA manual, but I could not find
anything.

Is there a Go to function that can help me?

Thanks for your help



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
Change line in Chart JeroenM Charts and Charting in Excel 4 October 26th 05 08:07 AM
Label an average line in a dynamic chart John Cordes Charts and Charting in Excel 3 June 17th 05 09:42 AM
coloring overy other line without doing so line by line gen Excel Worksheet Functions 5 April 1st 05 10:38 PM
Formatting lines between data points in a line chart ltanner Charts and Charting in Excel 2 March 13th 05 05:12 AM
Line chart - date line association gone mad! Johannes Czernin Charts and Charting in Excel 5 January 17th 05 08:48 PM


All times are GMT +1. The time now is 03:04 AM.

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

About Us

"It's about Microsoft Excel"