jim may
Well-known Member
- Joined
- Jul 4, 2004
- Messages
- 7,486
I have some dates and integers Row 3) across several columns -- The below code in "Worksheet_Change" code. If my target value is say 20
I need for the Msgbox to appear with the statement "You have entered a Weekend Date". What am I not doing right? The Range Name "VALIDDAYS" is a joined range G3:K3, M3:Q3 and the For Each is properly reading each one correctly
Excel 2012
<COLGROUP><COL style="BACKGROUND-COLOR: #dae7f5"><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
I need for the Msgbox to appear with the statement "You have entered a Weekend Date". What am I not doing right? The Range Name "VALIDDAYS" is a joined range G3:K3, M3:Q3 and the For Each is properly reading each one correctly
Excel 2012
G | H | I | J | K | L | M | N | |
---|---|---|---|---|---|---|---|---|
1 | 15-Sep | 16-Sep | 17-Sep | 18-Sep | 19-Sep | X | 22-Sep | 23-Sep |
2 | Mon | Tue | Wed | Thu | Fri | Mon | Tue | |
3 | 15 | 16 | 17 | 18 | 19 | 22 | 23 |
<COLGROUP><COL style="BACKGROUND-COLOR: #dae7f5"><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Cash Proj
Code:
.....
For Each C In Range("ValidDays").Cells
If C.Value <> Target.Value Then
'Do nothing
Else
MsgBox "You have entered a Weekend Date"
Application.Undo
Exit For
End If
Next C
[/code}