- Katılım
- 24 Ağustos 2007
- Mesajlar
- 74
- Excel Vers. ve Dili
- işte excel 2003 Türkçe
evde excel 2007 Türkçe
Dikey verilerin diğer sayfada yatay olarak sıralanması için makro ya da vba için tüm arkadaşlara teşekkürler
Sub yatay()
Dim hcr As Range, k As Range, sat As Long, sut As Integer, sonsut As Long
Sheets("Sayfa2").Select
Application.ScreenUpdating = False
Range("A1:IV65536").ClearContents
Range("A1").Value = "ADI"
sat = 2
For Each hcr In Sheets("Sayfa1").Range("B2:B" & Sheets("Sayfa1").Cells(65536, "B").End(xlUp).Row)
tekrar:
Set k = Range("A2:A65536").Find(hcr.Value, , xlValues, xlWhole)
If k Is Nothing Then
Cells(sat, "A").Value = hcr.Value
sat = sat + 1
GoTo tekrar
Else
sut = Cells(k.Row, 256).End(xlToLeft).Column + 1
If sut > sonsut Then sonsut = sut
Cells(k.Row, sut).Value = hcr.Offset(0, -1).Value
End If
Next hcr
For i = 2 To sonsut
Cells(1, i).Value = i - 1
Next
Application.ScreenUpdating = True
MsgBox "İşlem Tamamdır..!!", vbOKOnly + vbInformation, Application.UserName
End Sub