Merhaba ustadlarım sorunumu ektekı dosyada detaylı anlatmaya calıstım yaklasık on bın farklı ısımde excel var eger rıcamın çözümü varsa benı çok buyuk bır yukten kurataracak ılgınız ıcın sımdıden tesekkurler
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub Edit_Files()
Dim My_Path As String, My_File As String, Find_Text As Range
Dim WB As Workbook, WS As Worksheet, First_Row As Long
Dim Last_Cell As Range, Body_Last_Column As Integer
Dim First_Cell As Range, Table_Last_Cell As Range
Dim First_Adress As String, Last_Adress As String
Application.ScreenUpdating = False
My_Path = "C:\Users\Test\"
My_File = Dir(My_Path & "*.xls*")
While My_File <> ""
If My_File <> ThisWorkbook.Name Then
Set WB = Workbooks.Open(My_Path & My_File, False, False)
Set WS = WB.Sheets("ÖLÇÜ TABLOSU")
Set Find_Text = WS.Cells.Find(What:="GENEL KRİTİKLER", After:=WS.Cells(1), LookIn:=xlValues, LookAt:=xlPart)
If Not Find_Text Is Nothing Then
First_Row = WS.Cells(1, "A").End(4).Row
WS.Range("A" & First_Row & ":E" & Find_Text.Row - 1).Cut WS.Cells(WS.Rows.Count, 1).End(3)(2, 1)
Set Last_Cell = WS.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious)
If Not Last_Cell Is Nothing Then
Body_Last_Column = WS.Cells(2, WS.Columns.Count).End(1).Offset(, 1).Column
Set First_Cell = WS.Cells(2, Body_Last_Column).Resize(Find_Text.Row - 1, 5).Find("*", LookIn:=xlValues)
If Not First_Cell Is Nothing Then
Set Table_Last_Cell = WS.Cells.SpecialCells(xlCellTypeLastCell)
First_Adress = WS.Cells(First_Cell.Row, Body_Last_Column).Address
Last_Adress = WS.Cells(Find_Text.Row - 1, Table_Last_Cell.Column).Address
WS.Range(First_Adress & ":" & Last_Adress).Cut WS.Cells(WS.Rows.Count, 1).End(3)(2, 1)
End If
End If
End If
WB.Close True
End If
My_File = Dir
Wend
Set Last_Cell = Nothing
Set First_Cell = Nothing
Set Table_Last_Cell = Nothing
Set Find_Text = Nothing
Set WB = Nothing
Set WS = Nothing
Application.ScreenUpdating = True
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Option Explicit
Sub Edit_Files()
Dim My_Path As String, My_File As String
Dim WB As Workbook, WS As Worksheet, First_Row As Long
Dim Last_Cell As Range, Body_Last_Column As Integer
Dim First_Cell As Range, Table_Last_Cell As Range
Dim First_Adress As String, Last_Adress As String
Dim X As Long, Find_Text_Row As Long
Application.ScreenUpdating = False
My_Path = "C:\Users\Test\"
My_File = Dir(My_Path & "*.xls*")
While My_File <> ""
If My_File <> ThisWorkbook.Name Then
Set WB = Workbooks.Open(My_Path & My_File, False, False)
Set WS = WB.Sheets("ÖLÇÜ TABLOSU")
For X = WS.Cells(WS.Rows.Count, 1).End(3).Row To 1 Step -1
For Y = 1 To 52
If WS.Cells(X, Y) = "GENEL KRİTİKLER" Then
Find_Text_Row = X
Exit For
End If
Next
Next
First_Row = WS.Cells(1, "A").End(4).Row
WS.Range("A" & First_Row & ":E" & Find_Text_Row - 1).Cut WS.Cells(WS.Rows.Count, 1).End(3)(2, 1)
Set Last_Cell = WS.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious)
If Not Last_Cell Is Nothing Then
Body_Last_Column = WS.Cells(2, WS.Columns.Count).End(1).Offset(, 1).Column
Set First_Cell = WS.Cells(2, Body_Last_Column).Resize(Find_Text_Row - 1, 5).Find("*", LookIn:=xlValues)
If Not First_Cell Is Nothing Then
Set Table_Last_Cell = WS.Cells.SpecialCells(xlCellTypeLastCell)
First_Adress = WS.Cells(First_Cell.Row, Body_Last_Column).Address
Last_Adress = WS.Cells(Find_Text_Row - 1, Table_Last_Cell.Column).Address
WS.Range(First_Adress & ":" & Last_Adress).Cut WS.Cells(WS.Rows.Count, 1).End(3)(2, 1)
End If
End If
WB.Close True
End If
My_File = Dir
Wend
Set Last_Cell = Nothing
Set First_Cell = Nothing
Set Table_Last_Cell = Nothing
Set Find_Text = Nothing
Set WB = Nothing
Set WS = Nothing
Application.ScreenUpdating = True
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub