I have a spreadsheet that has 137000+ lines in it which means that I do not want to have lots of excel formulas recalculating at every move. Therefore I created a series of macros to do the job for me. This was working perfectly until recently, and it now stops at row 32767 and hangs until I crash out. I don't understand what has changed. Hopefully one of you clever people can help a novice in need.
Here is an example of one of my subs where this is happening. All I want to do with this is a vlookup as long as it meets a certain requirement which works fine until I hit the row limit:
Sub FGLOH()
Dim FGLOHINT As Integer
FGLOHINT = 3
Sheets("Calculation of Final LOH").Select
Sheets("Calculation of Final LOH").Range("A" & FGLOHINT).Activate
Do Until IsEmpty(ActiveCell)
Sheets("Calculation of Final LOH").Select
Sheets("Calculation of Final LOH").Range("A" & FGLOHINT).Activate
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
Sheets("Calculation of Final LOH").Range("H" & FGLOHINT).Value = 0
FGLOHINT = FGLOHINT + 1
Else
Dim FGLOH As String
FGLOH = Sheets("Calculation of Final LOH").Range("A" & FGLOHINT).Value
On Error GoTo 0
On Error Resume Next
Sheets("Calculation of Final LOH").Range("H" & FGLOHINT).Value = Application.WorksheetFunction.VLookup(FGLOH, Sheets("Work Centre LOH Lookup").Range("A2:M200000"), 13, False)
FGLOHINT = FGLOHINT + 1
End If
Loop
End Sub