Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I'm managing a lot of data with a complex macro.
At a certain point, Excel stops to work.
The message is:
Microsoft Excel has stopped working
Windows is checking for a solution to a problem
I have identified the part of code where the event happens.
lrt = 4586, the event happens beetween lrt = 2000 and lrt = 3000
Any suggestion?
I'm managing a lot of data with a complex macro.
At a certain point, Excel stops to work.
The message is:
Microsoft Excel has stopped working
Windows is checking for a solution to a problem
I have identified the part of code where the event happens.
lrt = 4586, the event happens beetween lrt = 2000 and lrt = 3000
Any suggestion?
Code:
Dim lrt As Long
lrt = Worksheets("Alpha").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))
End If
Next