Dear Excel Forum,
First, I would like to note that technically this is two questions within a single thread, but it is the same problem just two possible solutions. I hope that is acceptable.
I have some statements here and could not figure out a neat way to combine them. What would be an effective way of conveying the code below?
If deleteStr = "" And timeB < 59 Then
MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
"Total Time Taken: " & (timeB Mod 60) & _
" second(s)", vbInformation, "Log Summary"
End If
If deleteStr = "" And timeB >= 60 Then
MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
"Total Time Taken: " & Round((timeB / 60), 0) & " minute(s) and " & (timeB Mod 60) & _
" second(s)", vbInformation, "Log Summary"
End If
If deleteStr <> "" And timeB < 59 Then
MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
"Respondent answers matching '" & deleteStr & "' have been removed." & vbCrLf & vbCrLf & _
"Total Time Taken: " & (timeB Mod 60) & _
" second(s)", vbInformation, "Log Summary"
End If
If deleteStr <> "" And timeB >= 60 Then
MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
"Respondent answers matching '" & deleteStr & "' have been removed." & vbCrLf & vbCrLf & _
"Total Time Taken: " & Round((timeB / 60), 0) & " minute(s) and " & (timeB Mod 60) & _
" second(s)", vbInformation, "Log Summary"
End If
An alternative route would of course be: How do I fix the syntax for my MsgBox Timer so that it displays run time properly when run time is less than 60 seconds? What happens currently is for times between 30 and 59, it displays "1 minute(s) and x second(s)" instead of "0 minute(s) and x second(s)".
"Total Time Taken: " & Round((timeB / 60), 0) & " minute(s) and " & (timeB Mod 60) & " second(s)"
Best,
Doug
Bookmarks