Hi,
I have this code which giving me a run time error 13, can't figure out the reason why...
Thanks for the help
HYKE
I have this code which giving me a run time error 13, can't figure out the reason why...
Code:
Private Sub ComboBox1_Change()
Dim B As Long
With Sheet2
[COLOR=red] B = Application.Match(ComboBox1.Value, .Range("B:B"), False)-this part is highlighted on runtime error
[/COLOR] Label8.Caption = .Cells(B, 3).Value
End With
End Sub
Private Sub CommandButton1_Click()
Dim r As Long
With Sheet2
r = Application.Match(ComboBox1.Value, .Range("B:B"), False)
.Cells(r, 4).Value = .Cells(r, 4).Value + Val(TextBox2.Value)
.Cells(r, 5).Value = .Cells(r, 5).Value + Val(TextBox3.Value)
.Cells(r, 6).Value = .Cells(r, 6).Value + Val(TextBox4.Value)
.Cells(r, 7).Value = TextBox5.Value
.Cells(r, 8).Value = TextBox6.Value
.Cells(r, 9).Value = TextBox7.Value
If OptionButton1 = True Then
.Cells(r, 27).Value = .Cells(r, 27).Value + Val(TextBox8.Value)
.Cells(r, 28).Value = TextBox9.Value
.Cells(r, 29).Value = .Cells(r, 29).Value + Val(TextBox10.Value)
.Cells(r, 30).Value = TextBox11.Value
.Cells(r, 31).Value = .Cells(r, 31).Value + Val(TextBox12.Value)
.Cells(r, 32).Value = TextBox13.Value
End If
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
ComboBox1.Value = ""
ComboBox1.SetFocus
Range("a1").Select
End With
End Sub
Thanks for the help
HYKE