- Katılım
- 4 Mayıs 2007
- Mesajlar
- 3,677
- Excel Vers. ve Dili
- 2016 PRO TÜRKÇE-İNG. 64 BİT
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Syn. kuvari,
Verileriniz sabit mi? Eksilme ya da artma oluyor mu? Dosyanızın çalışma mantığını açıklar mısınız? Eğer veriler sabitse farklı kod, değişkense farklı kod yazmak gerekiyor. Bu nedenle kesin bilgiler vermeniz gerekiyor.
Sub ToplamEkle()
Sat = [a65536].End(3).Row + 2
Cells(Sat, "h") = ""
Cells(Sat, "g") = ""
Cells(Sat, "g") = "TOPLAM"
For i = 3 To [I65536].End(3).Row
Cells(Sat, "h") = Cells(Sat, "h") + Cells(i, "ı")
Next i
End Sub
Bu kodla İlk iki isteğinizi yapabilirsiniz. Yani "TOPLA" yazar ve yanına belirttiğiniz sütunu toplar. Ancak bu kodu veri kaydetme kodlarınıza uygun şekilde yerleştirmeniz gerekli.Kod:Sub ToplamEkle() Sat = [a65536].End(3).Row + 2 Cells(Sat, "h") = "" Cells(Sat, "g") = "" Cells(Sat, "g") = "TOPLAM" For i = 3 To [I65536].End(3).Row Cells(Sat, "h") = Cells(Sat, "h") + Cells(i, "ı") Next i End Sub
Şu an 730'uncu satır dolu, mesela 731. satıra girişi ne ile yapıyorsunuz? Bu kodu sizin kodlarınıza uyarlamamız gerek. Açıklama istememin sebebi bu. Uyarlamayı benim yapmam için kodları görmem gerekli.
Listeleme konusunda bir fikrim yok. Önce ilk isteğinizi halledelim. Sonra ayrı bir başlıkta listelemeyi açıp, iyice açıklarsınız.
Sub Makro1()
Sat = [a65536].End(3).Row + 2
Cells(Sat, "f") = ""
Cells(Sat, "e") = ""
Columns("J:M").Select
Selection.Delete Shift:=xlToLeft
Columns("H:H").Select
Selection.Delete Shift:=xlToLeft
Columns("D:E").Select
Selection.Delete Shift:=xlToLeft
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1:F1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Range("C2").Select
Selection.AutoFilter
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.15748031496063)
.RightMargin = Application.InchesToPoints(0.15748031496063)
.CenterHorizontally = True
End With
Cells(Sat, "e") = "TOPLAM"
Cells(Sat, "f").FormulaR1C1 = "=SUBTOTAL(9,R3C:R[-2]C)"
End Sub
Bu şekilde dener misiniz?
Kod:Sub Makro1() Sat = [a65536].End(3).Row + 2 Cells(Sat, "f") = "" Cells(Sat, "e") = "" Columns("J:M").Select Selection.Delete Shift:=xlToLeft Columns("H:H").Select Selection.Delete Shift:=xlToLeft Columns("D:E").Select Selection.Delete Shift:=xlToLeft Cells.Select Cells.EntireColumn.AutoFit Range("A1:F1").Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Selection.Merge Range("C2").Select Selection.AutoFilter With ActiveSheet.PageSetup .LeftMargin = Application.InchesToPoints(0.15748031496063) .RightMargin = Application.InchesToPoints(0.15748031496063) .CenterHorizontally = True End With Cells(Sat, "e") = "TOPLAM" Cells(Sat, "f").FormulaR1C1 = "=SUBTOTAL(9,R3C:R[-2]C)" End Sub