I would like to solve the following testing problem. If there is an error i.e. (=1/0) in a cell, the additional tests will not run after that. I would like to know how to solve this issue in the testing primary task part.
Private Sub ts_NoBlank(TsCn, STST, LsSt, LsIn, TsRw, MsCo, MsIC, MsSt)
Dim TsCl, StRw, LsRw, TsSh
TsCl = ColNrOfField(TsCn)
StRw = FsRwOfField(TsCn) + 1
LsRw = LsRwOfField(TsCn)
TsSh = SheetOfField(TsCn)
' Setting up Status Updates
PLcSt = -1 'Starting previous local status is set to -100% to show eitherways
rws = LsRw - StRw
'this part has to be copied to whenever showing the status (Value of LcSt has to be added each time by function)
LcSt = 0
If LcSt - PLcSt >= LsIn Then
Call ShowStatus(MsSt & " (" & Application.WorksheetFunction.Text(LcSt, "0%") & ")", ThisWorkbook.Worksheets("Calculations Running").Range("Started"), STST + (LsSt - STST) * LcSt)
PLcSt = LcSt
End If
' Testing primary task
ErrNr = 0
For Rw = StRw To LsRw 'ToDo speed up with fromrow torow
If Len(ThisWorkbook.Sheets(TsSh).Cells(Rw, TsCl)) = 0 Then
ThisWorkbook.Sheets(TsSh).Cells(Rw, TsCl).Interior.ColorIndex = 46
ErrNr = ErrNr + 1
End If
'Showing Local Status
LcSt = 0.1 + ((Rw / LsRw) * 0.75)
If LcSt - PLcSt >= LsIn Then
Call ShowStatus(MsSt & " (" & Application.WorksheetFunction.Text(LcSt, "0%") & ")", ThisWorkbook.Worksheets("Calculations Running").Range("Started"), STST + (LsSt - STST) * LcSt)
PLcSt = LcSt
End If
Next Rw
' Updating Test Results on 'Testing' Page
TRRg = "test" & TsRw & "_results"
If ErrNr = 0 Then 'If Results are Positive
ThisWorkbook.Worksheets("Testing").Range(TRRg) = MsCo
ThisWorkbook.Worksheets("Testing").Range(TRRg).Interior.ColorIndex = 51
Else 'If Errors are found
ErrMS = NumberizeMessage(MsIC, "SP_textvers", "S_textvers", "P_textvers", ErrNr)
ThisWorkbook.Worksheets("Testing").Range(TRRg) = ErrMS
ThisWorkbook.Worksheets("Testing").Range(TRRg).Interior.ColorIndex = 3
End If
'Showing Local Status
LcSt = 0.1
If LcSt - PLcSt >= LsIn Then
Call ShowStatus(MsSt & " (" & Application.WorksheetFunction.Text(LcSt, "0%") & ")", ThisWorkbook.Worksheets("Calculations Running").Range("Started"), STST + (LsSt - STST) * LcSt)
PLcSt = LcSt
End If
' Highlighting erroneous cells (if not done during testing)
If ErrNr > 0 Then
End If
'Showing Local Status 100%
LcSt = 1
If LcSt - PLcSt >= LsIn Then
Call ShowStatus(MsSt & " (" & Application.WorksheetFunction.Text(LcSt, "0%") & ")", ThisWorkbook.Worksheets("Calculations Running").Range("Started"), STST + (LsSt - STST) * LcSt)
PLcSt = LcSt
End If
End Sub
Aucun commentaire:
Enregistrer un commentaire