Cells(s, 1).EntireRow.Delete start working too slowly with new MS 365. Some fastes option?

beaster

New Member
Joined
Feb 21, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
VBA Code:
Code:
Code:
Dim r, k As Integer
    Dim kdnr As String
    Dim kdname As String
    Dim Arr As Variant
    
    Application.PrintCommunication = False
    Application.EnableEvents = False
    Application.ScreenUpdating = False
            
    r = 3
    
    Arr = Array(".", ",", ";", "\", "/", "?", "'", ":", "<", ">", "*", "%", "&", "@", "#", "$")
    
    Do Until IsEmpty(Cells(r, 1))
    
    Sheets(2).Select
    
    If Cells(r, 11) < 1 Then
    
    r = r + 1
    
    Else

    kdnr = Cells(r, 2)
    kdname = Cells(r, 3)
        
    For i = LBound(Arr) To UBound(Arr)
        kdname = Replace(kdname, Arr(i), "")
    Next i
    
    Sheets(1).Copy
    
    ActiveWorkbook.SaveAs Filename:="H:\Branches\DACH330\Sales\POHLADAVKY\KlientiMakro\" & kdname & ".xlsx"
    
    Dim s As Integer
    Dim rng As Range
    
    s = 2
    Do Until IsEmpty(Cells(s, 1))
    If Cells(s, 2) <> kdnr Then
    Cells(s, 1).EntireRow.Delete
    Else
    s = s + 1
    End If
    Loop
    
    ActiveWindow.Close savechanges:=True
    
    Windows(wbName).Activate
    Sheets(2).Select
    
    r = r + 1
    
    End If
      
    Loop
    
    Application.PrintCommunication = True
    Application.EnableEvents = True
    Application.ScreenUpdating = True
Code:
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,215,374
Messages
6,124,574
Members
449,173
Latest member
Kon123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top