- Katılım
- 28 Eylül 2007
- Mesajlar
- 4,042
- Excel Vers. ve Dili
- 2013 Türkçe
Arkadaşlar merhaba.
Makro ile hücreleri nasıl birleştirip, nasıl çözebiliriz.
Makro ile hücreleri nasıl birleştirip, nasıl çözebiliriz.
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Range("A1:B1").Select
Selection.Merge
Range("A1:B1").Select
Selection.unMerge
Sub Makro()
With Range("A1:C5")
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
.Merge
End With
End Sub
Sub Merge() 'müşteri no'ya göre seçilen sütunlardaki hücreleri birleştirir.
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For i = 4 To Range("A4").End(4).Row
If Cells(i, 1) <> Cells(i + 1, 1) Then
Range(Cells(basla + 1, 1), Cells(basla + say + 1, 1)).Merge
Range(Cells(basla + 1, 9), Cells(basla + say + 1, 9)).Merge
Range(Cells(basla + 1, 10), Cells(basla + say + 1, 10)).Merge
basla = i
say = Empty
Else
say = say + 1
End If
Next i
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Sub Birlestir()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For i = 4 To Range("A4").End(4).Row
If Cells(i, 1) <> Cells(i + 1, 1) Then
Range(Cells(basla + 1, 1), Cells(basla + say + 1, 1)).Merge
Range(Cells(basla + 1, 1), Cells(basla + say + 1, 1)).HorizontalAlignment = xlCenter
Range(Cells(basla + 1, 1), Cells(basla + say + 1, 1)).VerticalAlignment = xlCenter
Range(Cells(basla + 1, 9), Cells(basla + say + 1, 9)).Merge
Range(Cells(basla + 1, 9), Cells(basla + say + 1, 9)).HorizontalAlignment = xlCenter
Range(Cells(basla + 1, 9), Cells(basla + say + 1, 9)).VerticalAlignment = xlCenter
Range(Cells(basla + 1, 10), Cells(basla + say + 1, 10)).Merge
Range(Cells(basla + 1, 10), Cells(basla + say + 1, 10)).HorizontalAlignment = xlCenter
Range(Cells(basla + 1, 10), Cells(basla + say + 1, 10)).VerticalAlignment = xlCenter
basla = i
say = Empty
Else
say = say + 1
End If
Next i
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub