Antonov,
I noticed that it appears that you are using these boxes:
TextBox1
TextBox2
ComboBox1
ComboBox2
ComboBox4
I did not see where the values were entered or used from
ComboBox3, other than at the very bottom.
The variable "findvalue" is identified in ComboBox4.
Where is TextBox4 in the subroutine below? How does it
tie in?
To clarify this, what I would do is write it in "pseudo"
code. It might help you understand it better too. Just
write it out in plain English like this:
For example:
If the last character of my variable is "L" Then
(Do this....)
Else If
(Do that....)
End If
If you write out all the logic that way for the whole
subroutine (without knowing the technical syntax), it
would help explain it more clearly. It might help you as
well. I have trouble following what you want precisely.
You might want to resubmit this to the newsgroup, with
some of my suggestions.
Please be persistent (that is, no need to apologize for
bothering me....) You'll finally figure it out. I'm sure
someone will catch on to what you want, and you'll find a
solution. A lot of nice people have helped me with some
complex solutions, with problems that I've had. I'm glad
to help you too.
-----Original Message-----
Hello Rick, sorry to bother you again but here you see what the
CommandButton has to do already. I've tried to squeeze your formula in this
but it didn't work.
You are right when you say that I need the Userform to input the data. The
sheet which should give me the answer to put in the TextBox4 is LOADSHEET
and the cell is I53. I understood the formula you wrote but I don't know
where to fit it in the formula's below.
Private Sub CommandButton1_Click()
[a1].Activate
findvalue = UCase(ComboBox4.Value)
If Not ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True) Is Nothing Then
ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True).Activate
Else
MsgBox "The Position could not be found"
Exit Sub
End If
With ActiveCell
If Right(findvalue, 1) = "L" Then
If .Offset(-1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)
Is Nothing Then
.Offset(-2, 0) = ComboBox2.Value
Else
MsgBox "Pallet already in use"
Exit Sub
End If
.Offset(-4, 0) = ComboBox1.Value
.Offset(-3, 0) = TextBox1.Value
.Offset(-1, 0) = TextBox2.Value
Else
MsgBox "Position is already taken"
Exit Sub
End If
Else
If .Offset(1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)