I have a problem with one of my macro: with a bigger amount of data then usual, Excel crashes without reporting the type of error.
I have isolated the part of the code which causes the matter, and it should be the following.
Application.ScreenUpdating = False
Dim lrt As Long
lrt = Worksheets("Records").Cells(Rows.Count, "A").End(xlUp).Row
For Each cellnum In Range("BF2:BH" & lrt)
If cellnum.Offset(0, 3).Value = "Z" Then
cellnum.Value = "0" & Trim(Str(cellnum))
Application.ScreenUpdating = True
In this case the amount of data is:
lrt (number of rows) = 2731
populated columns = 32
If I divide the data by 3 (about 1000 rows), the macro works correctly.
Thank you for any suggestion.