Thread: answer to Rick
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Axel Axel is offline
external usenet poster
 
Posts: 40
Default answer to Rick

Sorry, but it was so much scrolling, that it's better to answer you in a
new post.
The point is; -if nothing is written by user in textbox3, the existing
text in the cell that relate to textbox3 will not be changed.
if this still is confusing, I can send u the file
Thanks very mush for your help.
Aksel

My answer still holds, but I didn't realize how much code you had... it
holds for the ComboBox1 Change event. As for your CommandButton1 Click
event, I have a question. Consider this snippet of your code...

iCtr = ComboBox1.Value

Select Case [iCtr]
Case Is = 1
Range("B4") = Me.TextBox2
If TextBox3.Text = "" Then GoTo line1
Range("C4") = Me.TextBox3

line1:
Case Is = 2
Range("B5") = Me.TextBox2
If TextBox3.Text = "" Then GoTo line2
Range("C5") = Me.TextBox3

line2:
Case Is = 3
Range("B6") = Me.TextBox2
If TextBox3.Text = "" Then GoTo line3
Range("C6") = Me.TextBox3

line3:


If iCtr is 1, it falls into the first Case statement. If TextBox3.Text
is
the empty string, you have it go to the "line 1" label (and to "line 2"
label if it fails there, and so on). Why? If your code fell into the
first
Case statement, then iCtr equals 1, meaning it can't pass the second (or
any
of the other) Case statement conditions. All of this passing on through
the
various labels will never have a positive hit. I really am not sure what
you
are attempting here. Can you clarify what you think your code is doing?

Rick


*** Sent via Developersdex http://www.developersdex.com ***