View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.programming
Wouter HM Wouter HM is offline
external usenet poster
 
Posts: 99
Default Macro to Convert Value to Number, Sort, then Delete

Hi Dan,

This is my final version:

Declare Function timeGetTime Lib "winmm.dll" () As Long


Sub cardan()
'
' cardan Macro
'
Const WSnames As String = _
"Sheet1,Sheet2,Sheet3,Sheet4,Sheet5," & _
"Sheet6,Sheet7,Sheet8,Sheet9,Sheet10"

Dim lngStart As Long
Dim lngEnd As Long
Dim WS As Worksheet

lngStart = timeGetTime
'
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each WS In Worksheets(Split(WSnames, ","))
WS.Activate
Range("A5").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.AutoFilter
Range("A6").Select
ActiveSheet.Range("$A$1:$CC$8001").AutoFilter _
Field:=1, Criteria1:="Delete"
While UCase(ActiveCell.Text) < "DELETE"
ActiveCell.Offset(1, 0).Select
Wend
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter
Range("A5").Select
Next
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

lngEnd = timeGetTime

MsgBox lngEnd - lngStart & " milliseconds"


End Sub


The message box should appear after all tabs are processed.


HTH,

Wouter