Animalised
New Member
- Joined
- Apr 24, 2016
- Messages
- 31
Hi Everyone,
Im trying to have a message box state how much someone has overspent by, which works.. but it specifies that everyone has overspent (overspending by -£200), meaning that it opens a MsgBox for each person specified in the document (opening 18 MsgBox's in total).
Is there any way i can only open a message box if the person HAS actually overspent. I've tried to end the If function if the value = 0 but that isn't working!
A cut out of the code, along with my attempt, is below:
The full code is below, if interested:
Any help is very much appreciated, thank you!
Im trying to have a message box state how much someone has overspent by, which works.. but it specifies that everyone has overspent (overspending by -£200), meaning that it opens a MsgBox for each person specified in the document (opening 18 MsgBox's in total).
Is there any way i can only open a message box if the person HAS actually overspent. I've tried to end the If function if the value = 0 but that isn't working!
A cut out of the code, along with my attempt, is below:
Code:
If Range(Cells(12, "D")) > 200 Then
MsgBox "Jack Holdsworth has OVERSPENT by £" & Range("D12").Value - 200
ElseIf Range(Cells(12, "D")).Currency = 0 Then
End If
The full code is below, if interested:
Code:
If Range(Cells(7, "D")) > 200 Then MsgBox "Peter Beardsall has OVERSPENT by £" & Range("D7").Value - 200
End If
If Range(Cells(12, "D")) > 200 Then
MsgBox "Jack Holdsworth has OVERSPENT by £" & Range("D12").Value - 200
ElseIf Range(Cells(12, "D")).Currency = 0 Then
End If
If Range(Cells(17, "D")) > 200 Then
MsgBox "J/S Honley has OVERSPENT by £" & Range("D17").Value - 200
End If
If Range(Cells(22, "D")) > 200 Then
MsgBox "Paul Meldrum has OVERSPENT by £" & Range("D22").Value - 200
End If
If Range(Cells(27, "D")) > 200 Then
MsgBox "John Wilson has OVERSPENT by £" & Range("D27").Value - 200
End If
If Range(Cells(32, "D")) > 200 Then
MsgBox "Steve Armstrong has OVERSPENT by £" & Range("D32").Value - 200
End If
If Range(Cells(7, "H")) > 200 Then
MsgBox "Nick Dyson has OVERSPENT by £" & Range("H7").Value - 200
End If
If Range(Cells(12, "H")) > 200 Then
MsgBox "Stephen Helm has OVERSPENT by £" & Range("H12").Value - 200
End If
If Range(Cells(17, "H")) > 200 Then
MsgBox "Andy Lindley has OVERSPENT by £" & Range("H17").Value - 200
End If
If Range(Cells(22, "H")) > 200 Then
MsgBox "Robert Speight has OVERSPENT by £" & Range("H22").Value - 200
End If
If Range(Cells(27, "H")) > 200 Then
MsgBox "Kevin Taylor has OVERSPENT by £" & Range("H27").Value - 200
End If
If Range(Cells(32, "H")) > 200 Then
MsgBox "Ian Walsh has OVERSPENT by £" & Range("H32").Value - 200
End If
If Range(Cells(7, "L")) > 200 Then
MsgBox "Danny Greenwood has OVERSPENT by £" & Range("L7").Value - 200
End If
If Range(Cells(12, "L")) > 200 Then
MsgBox "Simon Hepworth has OVERSPENT by £" & Range("L12").Value - 200
End If
If Range(Cells(17, "L")) > 200 Then
MsgBox "Saj has OVERSPENT by £" & Range("L17").Value - 200
End If
If Range(Cells(22, "L")) > 200 Then
MsgBox "Stephen Wroe has OVERSPENT by £" & Range("L22").Value - 200
End If
If Range(Cells(27, "L")) > 200 Then
MsgBox "Paul Hirst has OVERSPENT by £" & Range("L27").Value - 200
End If
If Range(Cells(32, "L")) > 200 Then
MsgBox "Ben Andrewan has OVERSPENT by £" & Range("L32").Value - 200
End If
Any help is very much appreciated, thank you!
Last edited: