Send a warning message if the shift number is exceeded in Excel



Send a warning message if the shift number is exceeded in Excel. Warn if too many shifts have been entered in a row.
Click this link to check out my one-on-one training

For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Click for online Excel Consulting

I am able to provide online help on your computer at a reasonable rate.

I use a Blue condenser Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

TWEET THIS VIDEO

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.

link for insert VBA code in Excel

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range(“C4:NV15”)) Is Nothing Then
Call shiftcnt
End If
End Sub
Sub shiftcnt()
Dim cfor, cbac As Range

ActiveCell.Offset(-1, 0).Select

Set cfor = Range(ActiveCell, ActiveCell.Offset(0, 4))
Set cbac = Range(ActiveCell, ActiveCell.Offset(0, -4))

If Application.WorksheetFunction.CountIf(cfor, “D”)greater than 4 Or _
Application.WorksheetFunction.CountIf(cfor, “N”) greater than 4 Then
MsgBox “The Number of Shifts exceeded”
End If
If Application.WorksheetFunction.CountIf(cbac, “D”)greater than 4 Or _
Application.WorksheetFunction.CountIf(cbac, “N”)greater than 4 Then
MsgBox “The Number of Shifts exceeded”
End If

End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận