Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Snailspace Macro Needs Rejuvenation....Anyone?
Presented below is a macro called cleandata that runs at snailspace!!.
I would like 2 changes to this slow macro: 1. Change the reference of the worksheet from the name (in this case = new) to simply active worksheet, so that it is not name specific. 2. Speed it up so that it works faster. Sub Cleandata() Dim r As Long Application.ScreenUpdating = False With Worksheets("new") For r = .UsedRange.Rows.Count To 1 Step -1 If .Cells(r, "K").Value = "0" Then .Rows(r).Delete End If Next End With For Each c In [E1:E35000] Select Case c.Offset(0, 5).Text Case Is = "CRJ", "EM2", "ER3", "ER4", "ERD", "ERJ" c.Value = c.Value & IIf(Right(c.Text, 1) < "E", "E", "") End Select Next c Application.ScreenUpdating = True End Sub If you have some suggested improvements not mentioned above, please feel free to make them to the modified code. As always, thanks in advance to the great excel speedsters!! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |