Good Day Experts,
I have below code which copies data from numerous sheets in current workbook and update my summary sheet.
Problem is it little bit slow, do you guys have any better and faster advice.
For Speeding Up I have which doesn't help :
I have below code which copies data from numerous sheets in current workbook and update my summary sheet.
Problem is it little bit slow, do you guys have any better and faster advice.
Code:
Sub UpdateSummary()
Dim Ws As Worksheet
Dim lastRow As Long, LR As Long
Dim Col As Long
Dim sh As Integer
Dim c As String, d As String, e As String, f As String, g As String, i As String, j As String, k As String, l As String
Call FunctionalityOff
Set Ws = Worksheets("SummarySheet")
Application
For sh = 2 To 11
With Sheets(sh)
lastRow = Sheets(sh).Range("C" & Rows.Count).End(xlUp).Row
If Sheets(sh).Name <> Ws.Name Then
For a = 2 To lastRow
For Col = 3 To 3
If .Cells(a, Col) <> "" Then
c = .Cells(a, 3)
d = .Cells(a, 4)
e = .Cells(a, 5)
f = .Cells(a, 6)
g = .Cells(a, 7)
i = .Cells(a, 9)
j = .Cells(a, 10)
k = .Cells(a, 11)
l = .Cells(a, 12)
With Ws
.Range("C" & .Range("C" & .Rows.Count).End(xlUp).Row + 1).Value = c
.Range("D" & .Range("D" & .Rows.Count).End(xlUp).Row + 1).Value = d
.Range("E" & .Range("E" & .Rows.Count).End(xlUp).Row + 1).Value = e
.Range("F" & .Range("F" & .Rows.Count).End(xlUp).Row + 1).Value = f
.Range("G" & .Range("G" & .Rows.Count).End(xlUp).Row + 1).Value = g
.Range("I" & .Range("I" & .Rows.Count).End(xlUp).Row + 1).Value = i
.Range("J" & .Range("J" & .Rows.Count).End(xlUp).Row + 1).Value = j
.Range("K" & .Range("K" & .Rows.Count).End(xlUp).Row + 1).Value = k
.Range("L" & .Range("L" & .Rows.Count).End(xlUp).Row + 1).Value = l
End With
End If
Next
Next
End If
End With
Next
Call FunctionalityOn
End Sub
For Speeding Up I have which doesn't help :
Code:
Sub FunctionalityOff()
With Application
.ScreenUpdating = False
.DisplayStatusBar = False
.StatusBar = False
.EnableEvents = False
.Calculation = xlManual
End With
End Sub
Code:
Sub FunctionalityOn()
With Application
.ScreenUpdating = True
.DisplayStatusBar = True
.StatusBar = True
.EnableEvents = True
.Calculation = xlAutomatic
End With
End Sub