How to count cells with a particular data and change the cell data when a predefined limit is reached
I am in the process of making an attendance sheet for work . for which i take mobile number and the date as inputs and mark "P" for presence. if all is well the presence is marked as "P" else pop is shown
Question1: how can i show name of the person checked in, in the msg box,(just says checked in for now) the names are in column "B"
Question2: the number of times the person can come is restricted and the value for that is in column AP
for eg: the value is 5 so on the 5th time that he appears the cell should be marked as "PE"
also a pop up with an error should be seen
FYI... also in the field may appear Value "PU"
P's and pu's are marked in the columns E:AI, each for 1 day of the week
any help will be appreciated..
thnx
I am in the process of making an attendance sheet for work . for which i take mobile number and the date as inputs and mark "P" for presence. if all is well the presence is marked as "P" else pop is shown
Question1: how can i show name of the person checked in, in the msg box,(just says checked in for now) the names are in column "B"
Question2: the number of times the person can come is restricted and the value for that is in column AP
for eg: the value is 5 so on the 5th time that he appears the cell should be marked as "PE"
also a pop up with an error should be seen
FYI... also in the field may appear Value "PU"
P's and pu's are marked in the columns E:AI, each for 1 day of the week
Code:
Sub attendance()
Application.EnableCancelKey = xlDisabled
Dim FindString As String
Dim FindString1 As String
Dim Rng As Range
Do
FindString = InputBox("Enter Your Mobile Number")
FindString1 = InputBox("Enter todays Date - e.g 21 for 21/03/2015")
If FindString = "" Then Exit Sub
If Trim(FindString) <> "" And Trim(FindString1) <> "" Then
With Sheets("Attendance").Range("D:D")
Set Rng = .Find(What:=FindString, LookAt:=xlWhole)
If Not Rng Is Nothing Then
Rng.Offset(0, FindString1).Select
Rng.Offset(0, FindString1).Value = "P"
MsgBox "Checked In"
Else
MsgBox "Not Registered"
End If
End With
End If
Loop
End Sub
thnx