mahmed1
Well-known Member
- Joined
- Mar 28, 2009
- Messages
- 2,302
- Office Version
- 365
- 2016
- Platform
- Windows
Hi All
Hi can i transfer this code into an array and then output as its takes 3-4 minutes to update
Thank You
Hi can i transfer this code into an array and then output as its takes 3-4 minutes to update
VBA Code:
Sub Transpose_Attendance()
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim lrow As Long
Dim lcol As Long
Dim i As Long
Dim c As Long
Dim dDate As Variant
Dim lrow2 As Long
Application.ScreenUpdating = False
Set ws = ThisWorkbook.Worksheets("Attendance")
Set ws2 = ThisWorkbook.Worksheets("tbl_Attendance")
lrow = 58
lcol = 13
lrow2 = 2
For i = 5 To lrow
dDate = ws.Range("B" & i).Value
For c = 3 To lcol
ws2.Range("A" & lrow2).Value = dDate
ws2.Range("B" & lrow2).Value = ws.Cells(4, c).Value
ws2.Range("C" & lrow2).Value = ws.Cells(i, c).Value
lrow2 = lrow2 + 1
Next c
Next i
Application.ScreenUpdating = True
End Sub
Thank You