poojapradeep406
New Member
- Joined
- Jan 25, 2019
- Messages
- 1
Hi,
I am trying to write a code where if Total row cell value is more than 4 so it should given an error msg box and restrict the user to do entry.
i am using this code
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Private Sub Worksheet_Calculate()
If Range("A1:AS15").Value > 4 Then
MsgBox "Invalid entry. Enter value in another slot!", vbRetryCancel + vbExclamation
End If
End Sub</code>
Once user do entry in A1:A10 =1 so the total should be 4 only (i mean only 4 entry should allowed).
I am trying to write a code where if Total row cell value is more than 4 so it should given an error msg box and restrict the user to do entry.
i am using this code
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Private Sub Worksheet_Calculate()
If Range("A1:AS15").Value > 4 Then
MsgBox "Invalid entry. Enter value in another slot!", vbRetryCancel + vbExclamation
End If
End Sub</code>
Once user do entry in A1:A10 =1 so the total should be 4 only (i mean only 4 entry should allowed).