modoste
Altın Üye
- Katılım
- 31 Mayıs 2008
- Mesajlar
- 3,714
- Excel Vers. ve Dili
- Microsoft OFFİCE Ev ve İş 2019 TR
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub Create_List_From_Horizontal_Table()
Dim My_Data As Variant, Last_Row As Long, Last_Column As Integer, X As Long, Y As Integer
Dim First_Date As Date, End_Date As Date, Record_Count As Long, Proccess_Time As Double
Proccess_Time = Timer
Range("C8:G" & Rows.Count).ClearContents
First_Date = Range("C5").Value
End_Date = Range("G5").Value
Last_Row = Cells(Rows.Count, "L").End(3).Row
If Last_Row < 9 Then Last_Row = 9
Last_Column = Cells(7, Columns.Count).End(1).Column
My_Data = Range("J6:" & Cells(Last_Row, Last_Column).Address(0, 0))
ReDim My_List(1 To Rows.Count, 1 To 5)
For X = 3 To UBound(My_Data, 1)
If My_Data(X, 3) <> "" Then
For Y = 18 To Last_Column Step 6
If My_Data(1, Y - 13) >= First_Date And My_Data(1, Y - 13) <= End_Date Then
If My_Data(X, Y - 9) <> "" Then
Record_Count = Record_Count + 1
My_List(Record_Count, 1) = CDate(My_Data(1, Y - 13))
My_List(Record_Count, 2) = My_Data(X, 3)
My_List(Record_Count, 4) = My_Data(X, Y - 9)
End If
End If
Next
End If
Next
If Record_Count > 0 Then
Range("C8").Resize(Record_Count, 5) = My_List
MsgBox "Your transaction is complete." & vbCr & vbCr & _
"Processing time ; " & Format(Timer - Proccess_Time, "0.00") & " Second"
Else
MsgBox "No suitable records found.", vbExclamation
End If
End Sub