Hi, When I'm running Macro .... it take ages to save.. below is my code. suggest me how can I run my Macro faster. sumtume i have work to 488 row to 20000 rows
Sub Sufficient()
'Copy cells of cols A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S from rows containing "Sufficient" in
'col M of the active worksheet (Master) to cols
'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S of Sufficient(Sufficient)
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("Sufficient")
Dim sRow As Long 'row index on Master worksheet
Dim sCount As Long
sCount = 0
dRow = 1
For sRow = 1 To Range("S65536").End(xlUp).Row
'use pattern matching to find "Sufficient" anywhere in cell
If Cells(sRow, "S") Like "*Sufficient*" Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,B,C,D,E,F,G,H,I,J, K,L,M,N,O,P,Q,R,& S
Cells(sRow, "A").Copy Destination:=DestSheet.Cells(dRow, "A")
Cells(sRow, "B").Copy Destination:=DestSheet.Cells(dRow, "B")
Cells(sRow, "C").Copy Destination:=DestSheet.Cells(dRow, "C")
Cells(sRow, "D").Copy Destination:=DestSheet.Cells(dRow, "D")
Cells(sRow, "E").Copy Destination:=DestSheet.Cells(dRow, "E")
Cells(sRow, "F").Copy Destination:=DestSheet.Cells(dRow, "F")
Cells(sRow, "G").Copy Destination:=DestSheet.Cells(dRow, "G")
Cells(sRow, "H").Copy Destination:=DestSheet.Cells(dRow, "H")
Cells(sRow, "I").Copy Destination:=DestSheet.Cells(dRow, "I")
Cells(sRow, "J").Copy Destination:=DestSheet.Cells(dRow, "J")
Cells(sRow, "K").Copy Destination:=DestSheet.Cells(dRow, "K")
Cells(sRow, "L").Copy Destination:=DestSheet.Cells(dRow, "L")
Cells(sRow, "M").Copy Destination:=DestSheet.Cells(dRow, "M")
Cells(sRow, "N").Copy Destination:=DestSheet.Cells(dRow, "N")
Cells(sRow, "O").Copy Destination:=DestSheet.Cells(dRow, "O")
Cells(sRow, "P").Copy Destination:=DestSheet.Cells(dRow, "P")
Cells(sRow, "Q").Copy Destination:=DestSheet.Cells(dRow, "Q")
Cells(sRow, "R").Copy Destination:=DestSheet.Cells(dRow, "R")
Cells(sRow, "S").Copy Destination:=DestSheet.Cells(dRow, "S")
End If
Next sRow
MsgBox sCount & " Sufficient rows copied", vbInformation, "Transfer Done"
End Sub
Bookmarks