I feel like this code is taking way too long to process (2-3 minutes). It's quite basic so was wondering if there were any ways I could improve it?
Code:
Sub Sample1()
Dim LastRow As Long, i As Long
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
LastRow = ws.Range("A" & Rows.Count).End(xlUp).row
With ws
For i = 1 To LastRow
If .Range("F" & i).Value = "" Or .Range("F" & i).Value = "-" Then _
ws.Range("F" & i).Formula = "=IFERROR(INDEX('Sheet2'!C:C,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("F" & i) = Range("F" & i).Value
If .Range("G" & i).Value = "" Or .Range("G" & i).Value = "-" Then _
ws.Range("G" & i).Formula = "=IFERROR(INDEX('Sheet2'!D:D,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("G" & i) = Range("G" & i).Value
If .Range("H" & i).Value = "" Or .Range("H" & i).Value = "-" Then _
ws.Range("H" & i).Formula = "=IFERROR(INDEX('Sheet2'!H:H,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("H" & i) = Range("H" & i).Value
If .Range("I" & i).Value = "" Or .Range("I" & i).Value = "-" Then _
ws.Range("I" & i).Formula = "=IFERROR(INDEX('Sheet2'!F:F,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("I" & i) = Range("I" & i).Value
If .Range("J" & i).Value = "" Or .Range("J" & i).Value = "-" Then _
ws.Range("J" & i).Formula = "=IFERROR(INDEX('Sheet2'!E:E,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("J" & i) = Range("J" & i).Value
If .Range("K" & i).Value = "" Or .Range("K" & i).Value = "-" Then _
ws.Range("K" & i).Formula = "=IFERROR(PROPER(INDEX('Sheet2'!L:L,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0))),""-"")"
Range("K" & i) = Range("K" & i).Value
If .Range("L" & i).Value = "" Or .Range("L" & i).Value = "-" Then _
ws.Range("L" & i).Formula = "=IFERROR(INDEX('Sheet2'!O:O,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("L" & i) = Range("L" & i).Value
If .Range("M" & i).Value = "" Or .Range("M" & i).Value = "-" Then _
ws.Range("M" & i).Formula = "=IFERROR(INDEX('Sheet2'!I:I,MATCH('Sheet1'!A" & i & "&"""",'Sheet2'!A:A,0)),""-"")"
Range("M" & i) = Range("M" & i).Value
Next i
End With
End Sub