Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Sub unexpectedly jumps to another sub

Greetings all!

I have a userform with a lot of code. When I F8 through the code immediately
below and get to the line "UserForm1.ListBox1.ListIndex=0", it unexpectedly
jumps to another routine (second one below). How can I keep the top code
running without unexpectedly branching off elsewhere????

Thanks for your help!

Jeff
Tucson, Arizona

Private Sub OptionButton9_Click()

Worksheets("Glass").Range("AD9") = 1

Worksheets("Glass").Range("AD8") = 2

UserForm1.ListBox1.ListIndex = 0 (here is where it jumps to the code
below)

UserForm1.Frame3.Visible = False

UserForm1.ListBox1.Visible = False

UserForm1.Frame7.Visible = False

UserForm1.CheckBox3.Value = False

End Sub





Private Sub ListBox1_Click()

Dim Number As Integer, Warning As String, Ansr As Boolean

If GETout = True Then Exit Sub

Warning = "The thickness of this glass requires" + vbNewLine

Warning = Warning + "that it be polished or beveled. Please" + vbNewLine

Warning = Warning + "edit the edging options to your require-" + vbNewLine

Warning = Warning + "ments."

Worksheets("Glass").Range("AD12") = ListBox1.Text


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Sub unexpectedly jumps to another sub

That is because that event is being triggered by setting the Listindex
property.

Don't worry about it, it will return to where it left off.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeff Wright" wrote in message
news:8RRHg.7573$Mz3.3380@fed1read07...
Greetings all!

I have a userform with a lot of code. When I F8 through the code

immediately
below and get to the line "UserForm1.ListBox1.ListIndex=0", it

unexpectedly
jumps to another routine (second one below). How can I keep the top code
running without unexpectedly branching off elsewhere????

Thanks for your help!

Jeff
Tucson, Arizona

Private Sub OptionButton9_Click()

Worksheets("Glass").Range("AD9") = 1

Worksheets("Glass").Range("AD8") = 2

UserForm1.ListBox1.ListIndex = 0 (here is where it jumps to the code
below)

UserForm1.Frame3.Visible = False

UserForm1.ListBox1.Visible = False

UserForm1.Frame7.Visible = False

UserForm1.CheckBox3.Value = False

End Sub





Private Sub ListBox1_Click()

Dim Number As Integer, Warning As String, Ansr As Boolean

If GETout = True Then Exit Sub

Warning = "The thickness of this glass requires" + vbNewLine

Warning = Warning + "that it be polished or beveled. Please" + vbNewLine

Warning = Warning + "edit the edging options to your require-" + vbNewLine

Warning = Warning + "ments."

Worksheets("Glass").Range("AD12") = ListBox1.Text




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Sub unexpectedly jumps to another sub

Bob,

Thanks, Bob! Now realizing that this is a logical change of events, I added
a line to the second module: "If UserForm1.ListBox1.ListIndex=0 Then Exit
Sub," after which, of course, it returns to the intial sub.

Thanks again,

Jeff

"Bob Phillips" wrote in message
...
That is because that event is being triggered by setting the Listindex
property.

Don't worry about it, it will return to where it left off.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeff Wright" wrote in message
news:8RRHg.7573$Mz3.3380@fed1read07...
Greetings all!

I have a userform with a lot of code. When I F8 through the code

immediately
below and get to the line "UserForm1.ListBox1.ListIndex=0", it

unexpectedly
jumps to another routine (second one below). How can I keep the top code
running without unexpectedly branching off elsewhere????

Thanks for your help!

Jeff
Tucson, Arizona

Private Sub OptionButton9_Click()

Worksheets("Glass").Range("AD9") = 1

Worksheets("Glass").Range("AD8") = 2

UserForm1.ListBox1.ListIndex = 0 (here is where it jumps to the code
below)

UserForm1.Frame3.Visible = False

UserForm1.ListBox1.Visible = False

UserForm1.Frame7.Visible = False

UserForm1.CheckBox3.Value = False

End Sub





Private Sub ListBox1_Click()

Dim Number As Integer, Warning As String, Ansr As Boolean

If GETout = True Then Exit Sub

Warning = "The thickness of this glass requires" + vbNewLine

Warning = Warning + "that it be polished or beveled. Please" + vbNewLine

Warning = Warning + "edit the edging options to your require-" + vbNewLine

Warning = Warning + "ments."

Worksheets("Glass").Range("AD12") = ListBox1.Text





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Sub unexpectedly jumps to another sub

You already have a test in GETOut, you could set that to True before.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeff Wright" wrote in message
news:yhXHg.7575$Mz3.1078@fed1read07...
Bob,

Thanks, Bob! Now realizing that this is a logical change of events, I

added
a line to the second module: "If UserForm1.ListBox1.ListIndex=0 Then Exit
Sub," after which, of course, it returns to the intial sub.

Thanks again,

Jeff

"Bob Phillips" wrote in message
...
That is because that event is being triggered by setting the Listindex
property.

Don't worry about it, it will return to where it left off.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jeff Wright" wrote in message
news:8RRHg.7573$Mz3.3380@fed1read07...
Greetings all!

I have a userform with a lot of code. When I F8 through the code

immediately
below and get to the line "UserForm1.ListBox1.ListIndex=0", it

unexpectedly
jumps to another routine (second one below). How can I keep the top code
running without unexpectedly branching off elsewhere????

Thanks for your help!

Jeff
Tucson, Arizona

Private Sub OptionButton9_Click()

Worksheets("Glass").Range("AD9") = 1

Worksheets("Glass").Range("AD8") = 2

UserForm1.ListBox1.ListIndex = 0 (here is where it jumps to the code
below)

UserForm1.Frame3.Visible = False

UserForm1.ListBox1.Visible = False

UserForm1.Frame7.Visible = False

UserForm1.CheckBox3.Value = False

End Sub





Private Sub ListBox1_Click()

Dim Number As Integer, Warning As String, Ansr As Boolean

If GETout = True Then Exit Sub

Warning = "The thickness of this glass requires" + vbNewLine

Warning = Warning + "that it be polished or beveled. Please" + vbNewLine

Warning = Warning + "edit the edging options to your require-" +

vbNewLine

Warning = Warning + "ments."

Worksheets("Glass").Range("AD12") = ListBox1.Text







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
Excel Closes Unexpectedly Lisa E. Excel Discussion (Misc queries) 3 December 12th 07 04:33 PM
Excel quits unexpectedly Simon Brown Excel Worksheet Functions 1 May 4th 07 11:36 PM
Sub Exits Unexpectedly Walker Excel Programming 4 July 25th 05 10:43 PM
data changes unexpectedly Helen N. New Users to Excel 8 December 16th 04 03:49 PM
Macro unexpectedly jumps to other macros and functions Jeff Wright[_2_] Excel Programming 3 November 25th 04 01:47 PM


All times are GMT +1. The time now is 06:59 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"