dinesh2605
New Member
- Joined
- Sep 8, 2015
- Messages
- 41
Hi Friends,
I have a list of names in column "D".
From the below code,i need to replace the msgbox "you" with the resource name.
Current display :
MsgBox "You have entered less than 9 hours for below date".
Requirement eg :
Msgbox " John have entered less than 9 hours for below date"
"John" is one of the resource names in the colunm D.
PLEASE HELP>
--------------------------------------------------------------------------------------------------------------------------------------
For i = LBound(DateArray) + 1 To UBound(DateArray)
If DateArray(i) <> "" Then
If Application.WorksheetFunction.SumIf(DateRange, DateArray(i), DateRange.Offset(0, 1)) > 9 Then
MsgBox "You have entered more than 9 hours for below date" & vbNewLine & vbNewLine & DateArray(i) & vbNewLine & vbNewLine & "Please create new row with all the details add hours in overtime column"
ElseIf Application.WorksheetFunction.SumIf(DateRange, DateArray(i), DateRange.Offset(0, 1)) < 9 Then
MsgBox "You have entered less than 9 hours for below date" & vbNewLine & vbNewLine & DateArray(i) & vbNewLine & vbNewLine & "Please enter 9hrs for above date"
End If
End If
Next i
I have a list of names in column "D".
From the below code,i need to replace the msgbox "you" with the resource name.
Current display :
MsgBox "You have entered less than 9 hours for below date".
Requirement eg :
Msgbox " John have entered less than 9 hours for below date"
"John" is one of the resource names in the colunm D.
PLEASE HELP>
--------------------------------------------------------------------------------------------------------------------------------------
For i = LBound(DateArray) + 1 To UBound(DateArray)
If DateArray(i) <> "" Then
If Application.WorksheetFunction.SumIf(DateRange, DateArray(i), DateRange.Offset(0, 1)) > 9 Then
MsgBox "You have entered more than 9 hours for below date" & vbNewLine & vbNewLine & DateArray(i) & vbNewLine & vbNewLine & "Please create new row with all the details add hours in overtime column"
ElseIf Application.WorksheetFunction.SumIf(DateRange, DateArray(i), DateRange.Offset(0, 1)) < 9 Then
MsgBox "You have entered less than 9 hours for below date" & vbNewLine & vbNewLine & DateArray(i) & vbNewLine & vbNewLine & "Please enter 9hrs for above date"
End If
End If
Next i