DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub BulVeSil()
Dim i As Long, _
Sat As Long, _
j As Long, _
Adt As Integer, _
k As Integer, _
Kol As Integer, _
Sh1 As Worksheet, _
Sh2 As Worksheet, _
c As Range, _
Rng As Range, _
Adr As String, _
Dz(), _
d()
Set Sh1 = Sheets("Sayfa1")
Set Sh2 = Sheets("Sayfa2")
Sat = Sh1.Cells.Find("*", , , , xlByRows, xlPrevious).Row
Kol = Sh1.Cells.Find("*", , , , xlByColumns, xlPrevious).Column
Application.ScreenUpdating = False
For i = 2 To Sh2.Cells(Rows.Count, "A").End(3).Row
With Sh1.Range(Sh1.Cells(1, 1), Sh1.Cells(Sat, Kol))
Set c = .Find(Sh2.Cells(i, "A"), LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
Adt = Adt + 1
ReDim Preserve Dz(1 To Adt)
Dz(Adt) = c.Address
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End With
Next i
For i = 1 To UBound(Dz)
Range(Dz(i)).ClearContents
Next i
i = 0
For Each c In Sh1.Range(Sh1.Cells(1, 1), Sh1.Cells(Sat, Kol)).SpecialCells(xlCellTypeConstants, 23)
i = i + 1
ReDim Preserve d(1 To i)
d(i) = c.Value
Next c
Sh1.Range(Sh1.Cells(1, 1), Sh1.Cells(Sat, Kol)).ClearContents
j = 1
k = 0
For i = 1 To UBound(d)
k = k + 1
If k > Kol Then
k = 1
j = j + 1
End If
Sh1.Cells(j, k) = d(i)
Next i
Application.ScreenUpdating = True
MsgBox "İşlem bitmiştir..."
End Sub
Option Base 1
Option Compare Text
Sub BuyuktenKucugeAktar()
Dim Sh2 As Worksheet, _
Sh3 As Worksheet, _
i As Long, _
Son As Long, _
Sat As Long, _
Kol As Integer, _
BKol As Integer, _
SKol As Integer, _
KolAdt As Integer, _
Hucre As Range, _
Dizi() As Variant
Set Sh2 = Sheets("Sayfa2")
Set Sh3 = Sheets("Sayfa3")
KolAdt = 20
On Error Resume Next
Sh3.Select
Set Hucre = Application.InputBox("Başlanacak Hücreyi Seçiniz", "BAŞLANGIÇ NOKTASI BELİRLEME", Type:=8)
If Hucre Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Sat = Hucre.Row
Kol = Hucre.Column
BKol = Kol
SKol = BKol + KolAdt - 1
Son = Sh2.Cells(Rows.Count, "A").End(3).Row
ReDim Dizi(Son)
For i = 1 To Son
Dizi(i) = Sh2.Cells(i, "a")
Next i
BubbleSort Dizi
For i = 1 To UBound(Dizi)
Sh3.Cells(Sat, Kol) = Dizi(i)
Kol = Kol + 1
If Kol > SKol Then
Kol = BKol
Sat = Sat + 1
End If
Next i
End Sub
Function BubbleSort(TempArray As Variant)
Dim Temp As Variant
Dim i As Integer
Dim NoExchanges As Integer
' Loop until no more "exchanges" are made.
Do
NoExchanges = True
' Loop through each element in the array.
For i = 1 To UBound(TempArray) - 1
' If the element is greater than the element
' following it, exchange the two elements.
If TempArray(i) < TempArray(i + 1) Then
NoExchanges = False
Temp = TempArray(i)
TempArray(i) = TempArray(i + 1)
TempArray(i + 1) = Temp
End If
Next i
Loop While Not (NoExchanges)
End Function
Hocam elinize sağlık. Bir düzeltme gerekiyor sanırım. Başlangıç olarak C3 hücresini seçtim ilk sıra bitiminde alttan C4'ten başlaması gerekirken A4'ten başladı. O kısmı düzeltebilirsek sorun yok. Saygılarımla...
Ben öyle anlamıştım. BuyuktenKucugeAktar kodunu düzelttim.