Microsoft 365 and Office | Excel | For home | Windows
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I try to run this code my excel crashes. I assume it's because it's doing something indefinitely. What is wrong with it?
Range("O5").Select
Dim m As Integer
Do While ActiveCell.Value <> ""
If InStr(ActiveCell.Value, "n") > 0 Then
ActiveCell.Offset(0, -13).Select
ActiveCell.Value = m
If WorksheetFunction.Match(m, Range("N1:N300"), 0) = False Then
ActiveCell.Value.Select
ActiveCell.Offset(0, -1).Resize(1, 13).Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(1, 14).Resize(1, 1).Select
ElseIf WorksheetFunction.Match(m, Range("N1:N300"), 0) = True Then
ActiveCell.Value.Select
ActiveCell.Offset(1, 13).Select
ActiveCell.Offset(0, -14).Resize(1, 13).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(1, 14).Resize(1, 1).Select
End If
ElseIf InStr(ActiveCell.Value, "match") > 0 Then
ActiveCell.Offset(1, 0).Select
End If
Loop
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.