Making a macro more efficient

bearcub

Well-known Member
Joined
May 18, 2005
Messages
711
Office Version
  1. 365
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
I recorded this macro the other day but it takes about 30 seconds to run. I tried to clean it up the best i could but I'm wondering if using a loop might be more efficient.

Code:
Sub ClearBlanksSiteRepsRADelegates()
'
' ClearBlanksSiteRepsRADelegates Macro
' Clear sheet of non leadership positions before copying to appropirate SCC
'
'
    ActiveSheet.Range("$A$1:$BX$69000").AutoFilter FIELD:=43, Criteria1:="="
    ActiveCell.Offset(1, 0).Rows("1:69000").EntireRow.Select
    ActiveCell.Offset(1, 15).Range("A1").Activate
    Selection.Delete Shift:=xlUp
    ActiveSheet.Range("$A$1:$BX$4680").AutoFilter FIELD:=43, Criteria1:= _
        "=*Site*", Operator:=xlOr, Criteria2:="=*RA Delegate*"
    Selection.Delete Shift:=xlUp
    ActiveSheet.Range("$A$1:$BX$3500").AutoFilter FIELD:=43
    ActiveSheet.AutoFilterMode = "False"
End Sub
[code]/

The macro is to remove some positions in column 43 (AQ). 

Is there a more efficient way to do this so it won't take as much time to run?

Thank you for your help.,

Michael
 
Another option would be (untested)
Code:
skipt = Trim(inarr(i, 43)) = "" Or (InStr(1, inarr(i, 43), "*Site*", vbTextCompare) > 0) Or (InStr(1, inarr(i, 43), "RA Delegate", vbTextCompare) > 0)
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
It will always be Caps. I think I'm good, thank you for your help on the macro - great stuff!

Michael
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,450
Members
449,453
Latest member
jayeshw

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