ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Hi,
I have this working code shown below.
With Regards TextBox 10 it either enters £0.00 or the value from column S
What i am trying to do is the following,
£0.00 should be interior color vbYellow
BUT
If value from column S then interior vbRed
Ive tried a few variations to apply this but just keep breaking the code
I have this working code shown below.
With Regards TextBox 10 it either enters £0.00 or the value from column S
What i am trying to do is the following,
£0.00 should be interior color vbYellow
BUT
If value from column S then interior vbRed
Ive tried a few variations to apply this but just keep breaking the code
Rich (BB code):
Private Sub ComboBox1_Change()
Dim i As Long, LastRow As Long
LastRow = Sheets("GRASS").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
With Sheets("GRASS")
If .Cells(i, "A").Value = (Me.ComboBox1) Or .Cells(i, "A").Value = Val(Me.ComboBox1) Then
Me.TextBox1 = .Cells(i, "C").Value 'ADDRESS
Me.TextBox2 = .Cells(i, "E").Value 'TELEPHONE NUMBER
Me.TextBox3 = .Cells(i, "I").Value 'AREA
Me.TextBox4 = .Cells(i, "G").Value 'POST CODE
Me.TextBox5 = .Cells(i, "Y").Value 'MILES
Me.TextBox6 = Format(.Cells(i, "K").Value, "£#,##0.00") 'COST
Me.TextBox7 = .Cells(i, "M").Value 'NEXT DUE
Me.TextBox8 = .Cells(i, "Q").Value 'PAYMENT TYPE
Me.TextBox9 = .Cells(i, "U").Value 'DURATION
If Not IsEmpty(.Cells(i, "S").Value) Then Me.TextBox10.Value = Format(.Cells(i, "S").Value, "£#,##0.00"): GoTo nxt_line
Me.TextBox10.Value = "£0.00" 'OWES
nxt_line: Me.TextBox11 = .Cells(i, "W").Value 'NOTES
Me.TextBox12 = .Cells(i, "O").Value 'LAST CUT
Exit For
End If
End With
Next
End Sub