Last active
November 25, 2019 11:08
-
-
Save Vitosh/576d48073af3d4c469801a423a1997b5 to your computer and use it in GitHub Desktop.
Checks whether there are units in the array.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub TestMe() | |
Dim errorArray() | |
Dim checkArray As Integer | |
Dim errorString As String | |
Dim c As Range | |
Dim i As Long: i = 0 | |
Dim myRange As Range | |
Set myRange = Worksheets(1).Range("A1:E10") | |
For Each c In myRange | |
If IsError(c) = True Then | |
ReDim Preserve errorArray(i) | |
errorArray(i) = c.Address | |
i = i + 1 | |
End If | |
Next c | |
If Not Not errorArray Then | |
errorString = "An error(s) occured in following cell(s):" & Chr(10) | |
For i = 0 To UBound(errorArray) | |
errorString = errorString & errorArray(i) & Chr(10) | |
Next | |
Debug.Print errorString | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment