bademployee
Board Regular
- Joined
- Aug 19, 2010
- Messages
- 184
Hi all,
I'm using the following, but get a run-time error if any of the kg# user form textboxes are blank:
How do I get around this?
Thanks in advance
Mark
I'm using the following, but get a run-time error if any of the kg# user form textboxes are blank:
Code:
Private Sub convert1_Click()
Dim ws As Worksheet
Set ws = Worksheets("Blends")
If fert_rate.Value = "" Then Exit Sub
ws.Range("h22").Value = fert_rate
ws.Range("r9").Value = kg1.Value / fert_rate.Value * 100
ws.Range("r10").Value = kg2.Value / fert_rate.Value * 100
ws.Range("r11").Value = kg3.Value / fert_rate.Value * 100
ws.Range("r12").Value = kg4.Value / fert_rate.Value * 100
ws.Range("r13").Value = kg5.Value / fert_rate.Value * 100
ws.Range("r14").Value = kg6.Value / fert_rate.Value * 100
ws.Range("r15").Value = kg7.Value / fert_rate.Value * 100
Unload Me
End Sub
How do I get around this?
Thanks in advance
Mark