ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,232
- Office Version
- 2007
- Platform
- Windows
Hi,
Im using a basic code to advise me which label to be applied to a parcel.
I type a country into a cell then the code looks up a worksheet where next to that countries name are only 2 options.
One column is ITAS and the other is ISF,one cell will be empty and the other will have a tick in it.
Last few days at the post office ive been advised that the parcel has the wrong label on it.
My photo example shows the sheet where the code looks at.
As you can see ITALY would have a label ITAS but when i start to type this into the cell i am told to use ISF.
MOVING THE TICK FROM ONE CELL TO THE OTHER ON THE DATA SHEET MADE NO DIFFERENCE.
Hence why im stuck.
The code in use is shown below.
Im using a basic code to advise me which label to be applied to a parcel.
I type a country into a cell then the code looks up a worksheet where next to that countries name are only 2 options.
One column is ITAS and the other is ISF,one cell will be empty and the other will have a tick in it.
Last few days at the post office ive been advised that the parcel has the wrong label on it.
My photo example shows the sheet where the code looks at.
As you can see ITALY would have a label ITAS but when i start to type this into the cell i am told to use ISF.
MOVING THE TICK FROM ONE CELL TO THE OTHER ON THE DATA SHEET MADE NO DIFFERENCE.
Hence why im stuck.
The code in use is shown below.
Code:
Private Sub ComboBox1_Change() Dim vLkup As Variant
With ThisWorkbook.Worksheets("INFO")
vLkup = Application.Match(ComboBox1.Text, .Range("AI2:AI236"), 0)
If Not IsError(vLkup) Then
If .Cells(vLkup + 2, "AJ").Value <> "" Then TextBox1.Text = "INTERNATIONAL TRACK & SIGNED"
If .Cells(vLkup + 2, "AK").Value <> "" Then TextBox1.Text = "INTERNATIONAL SIGNED FOR"
End If
End With
End Sub
Private Sub TextBox1_Change()
If (Me.TextBox1.Value) = "INTERNATIONAL SIGNED FOR" Then
Me.LabelBox.Picture = LoadPicture(ThisWorkbook.Path & "\isf.jpg")
ElseIf (Me.TextBox1.Value) = "INTERNATIONAL TRACK & SIGNED" Then
Me.LabelBox.Picture = LoadPicture(ThisWorkbook.Path & "\itas.jpg")
End If
End Sub