tomboulter
New Member
- Joined
- Apr 3, 2011
- Messages
- 3
Hi guys just a quick one I hope. I'm having a bit of trouble with the code shown below. When I run it says the values of cells in the IF statement are empty when they do contain a value and i cant figure out why it doesn't work?
Anyway here's the code:
'PARAMETER CHECKS
'pH Level Individual
Private Sub pHIndCheck()
Dim LastRow As Long
LastRow = Worksheets("Samples").Range("C1048576").End(xlUp).Row
If txtpHLevel.Value > Worksheets("Parameters").Range("B3").Value And txtpHLevel.Value < Worksheets("Parameters").Range("B3").Value Then
Worksheets("Samples").Cells(LastRow, 3).Interior.Color = RGB(255, 0, 0)
MsgBox "Individual breach of pH Level in water sample. Take appropriate action.", vbCritical, "pH Level Breach"
End If
End Sub
Anyway here's the code:
'PARAMETER CHECKS
'pH Level Individual
Private Sub pHIndCheck()
Dim LastRow As Long
LastRow = Worksheets("Samples").Range("C1048576").End(xlUp).Row
If txtpHLevel.Value > Worksheets("Parameters").Range("B3").Value And txtpHLevel.Value < Worksheets("Parameters").Range("B3").Value Then
Worksheets("Samples").Cells(LastRow, 3).Interior.Color = RGB(255, 0, 0)
MsgBox "Individual breach of pH Level in water sample. Take appropriate action.", vbCritical, "pH Level Breach"
End If
End Sub