danjames11
New Member
- Joined
- Apr 22, 2009
- Messages
- 14
I have made an If statement that, will make a date go 3 months on from the date you select on a drop down list, today, yesterday, 2 days ago, and 3 days ago. And when you click the button it changes the date on the cell 2 away from teh active cell. But for some reason the first 4 If statements work (Quarterly), and he last 4 (monthly) do not. Heres the code, can you help please?
All the quarterly ones work, and the monthly ones do not. What have I done wrong?
Code:
Sub ClientPaid_Click()
If IsNumeric(Application.Match(ActiveCell.Value, Range("B13:B4000"), 0)) Then
If Range("D10") = "Quarterly" Then
If Range("L1") = "Today" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("O6").Value
Range("L1") = "Today"
Else
If Range("D10") = "Quarterly" Then
If Range("L1") = "Yesterday" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("O10").Value
Range("L1") = "Today"
Else
If Range("D10") = "Quarterly" Then
If Range("L1") = "2 days Ago" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("R6").Value
Range("L1") = "Today"
Else
If Range("D10") = "Quarterly" Then
If Range("L1") = "3 days Ago" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("R10").Value
Range("L1") = "Today"
Else
If Range("D10") = "Monthly" Then
If Range("L1") = "Today" Then
Range("C1").Select
Else
If Range("D10") = "Monthly" Then
If Range("L1") = "Yesterday" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("O11").Value
Range("L1") = "Today"
Else
If Range("D10") = "Monthly" Then
If Range("L1") = "2 days Ago" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("R7").Value
Range("L1") = "Today"
Else
If Range("D10") = "Monthly" Then
If Range("L1") = "3 days Ago" Then
ActiveCell.Range("C1").Select
ActiveCell = Range("R11").Value
Range("L1") = "Today"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Else
MsgBox "You need to Click on a Client Name, before you can select them as paid.", vbOKOnly, "Time For You Message - Paid Client"
End If
End Sub
All the quarterly ones work, and the monthly ones do not. What have I done wrong?
Last edited by a moderator: