16/04/2021, 18:59
feraz
Normalde Kaydet alttaki gibi olmalı.
Private Sub Kaydet_Click()
Dim VeriSyf As Worksheet, son As Long
Set VeriSyf = Sheets("TASARI")
VeriSyf.Cells.Clear
VeriSyf.[a1] = "SN"
VeriSyf.[B1] = "Sicili"
VeriSyf.[c1] = "Adý"
VeriSyf.[D1] = "Soy Adý"
VeriSyf.[e1] = "Rütbesi"
With ListBox2
If .ListCount = 0 Then Exit Sub
For a = 0 To .ListCount - 1
son = VeriSyf.Range("A" & Rows.Count).End(3).Row + 1
VeriSyf.Range("A" & son).Value = .list(a, 0)
VeriSyf.Range("B" & son).Value = .list(a, 1)
VeriSyf.Range("C" & son).Value = .list(a, 2)
VeriSyf.Range("D" & son).Value = .list(a, 3)
VeriSyf.Range("E" & son).Value = .list(a, 4)
Next a
End With
a = Empty
'Rütbeye Göre Sýrala
sonsat = VeriSyf.Cells(Rows.Count, 1).End(3).Row
If sonsat < 3 Then Exit Sub
Application.ScreenUpdating = False
VeriSyf.Range("A2", "A" & sonsat - 1).FormulaR1C1 = "=MATCH(RC[4],KONTROL!C[1],0)"
VeriSyf.Range("A2", "A" & sonsat - 1).Value = VeriSyf.Range("A2", "A" & sonsat - 1).Value
VeriSyf.Range("A2:N" & sonsat).Sort Key1:=VeriSyf.[a2], Order1:=xlAscending, Key2:=VeriSyf.[B2], ORder2:=xlAscending
VeriSyf.Range("A2").Value = "1"
VeriSyf.Range("A2", "A" & sonsat).DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Step:=1, Trend:=False
Application.ScreenUpdating = True
With VeriSyf.Rows(1).Font
.Name = "Times New Roman"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
.Color = vbRed
End With
'''''''''''''''''''''''''''' 1. Satýra Baþlýk Eklemek '''''''''''''''''''''''''''''''''''''''''''''
'tüm Sütünü eþit aralýkta yapar
VeriSyf.Cells.EntireColumn.AutoFit
'tüm Satýrý eþit aralýkta yapar
VeriSyf.Cells.EntireRow.AutoFit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set VeriSyf = Nothing
MsgBox "aktarildi"
End Sub