0

I am quite inexperienced with vba and I am trying to make a code. I am running it and it works fine but it is too slow when I have many rows. And with slow I mean that it could be running for minutes. I didnt waited till the end yet. I would be very grateful for some help

Sub importart_lv()
Application.ScreenUpdating = False
Dim CL As Range
Dim rng As Range: Set rng = ActiveSheet.Range("A1:A2500")


For Each Cell In rng.Cells
    If Cell.Value = "Position" Then
        Cell.Offset(0, 6).Select
        Worksheets("Bausteine").Activate
        Range("G9:U9").Select
        Selection.Copy
        Worksheets("LV-Importieren").Activate
        Selection.Insert
        FindReplace
        
    End If
    
    'Cell.Offset(0, 11).Value = IIf(InStr(1, Cell, "Position"), "True", "")
Next
        Application.CutCopyMode = False
        ActiveSheet.Range("J1").Select
        Worksheets("Bausteine").Activate
        Range("G8:U8").Select
        Selection.Copy
        Worksheets("LV-Importieren").Activate
        Selection.Insert
        Application.CutCopyMode = False
        
Application.ScreenUpdating = True
End Sub
TitoElan
  • 1
  • 1
  • Reading [How to avoid select](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) will help you. – Ike Sep 22 '22 at 07:13

0 Answers0