Fantastic. Works perfectly. One final thing. I wanted to add a message to confirm the macro has run successfully and have modified your macro as below. It seems to work when tested it but I wanted to make sure that this is the right way of doing it.
Sub RunCogCalibrate()
Dim ws As Worksheet
For Each ws In Sheets
If ws.Name = "24WP" Or ws.Name = "24NS" Then
ws.Activate 'use this if your macro requires the worksheets to be the active sheet to work
Call CogCalibrate
End If
Next
Sheets("Contents").Activate
If txt_err = "" Then
MsgBox "All sheets have been processed successfully", vbInformation, "Confirmation"
Else
MsgBox "The following sheets could not be processed: " & Chr(10) & txt_err & Chr(10) & Chr(10) & _
"The other eligible sheets have been processed successfully", vbInformation, "Processed with errors"
End If
End Sub
Bookmarks