Merhaba arkadaşlar,
Makro kaydet yolu ile yaptığım makro boş satırlar içinde işlem yapmaktadır. Nasıl durdurabiliriz. Yardımcı olur musunuz.
A hücresini baz alabilirsiniz. A hücresi boş ise makro işlem yapmasın.
Makro kaydet yolu ile yaptığım makro boş satırlar içinde işlem yapmaktadır. Nasıl durdurabiliriz. Yardımcı olur musunuz.
A hücresini baz alabilirsiniz. A hücresi boş ise makro işlem yapmasın.
Kod:
Sub malzkontr()
'
' malzkontr Makro
'
'
Columns("N:S").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("N1").Select
ActiveCell.FormulaR1C1 = "sd"
Range("O1").Select
ActiveCell.FormulaR1C1 = "öner"
Range("P1").Select
ActiveCell.FormulaR1C1 = "ay"
Range("Q1").Select
ActiveCell.FormulaR1C1 = "1"
Range("R1").Select
ActiveCell.FormulaR1C1 = "2"
Range("S1").Select
ActiveCell.FormulaR1C1 = "3"
Columns("N:S").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("N2").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-8]:RC[-3])-RC[-2]"
Range("P2").Select
ActiveCell.FormulaR1C1 = "=(RC[6]+RC[7])/(12+MONTH(TODAY()))"
Range("Q2").Select
ActiveCell.FormulaR1C1 = "=RC[-3]-RC[-1]"
Range("R2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Range("S2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("N2:S2").Select
Selection.AutoFill Destination:=Range("N2:S42356")
Range("N2:S42356").Select
Calculate
Columns("P:P").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("P1").Select
ActiveCell.FormulaR1C1 = "açıklama"
Cells.Select
Range("D1").Activate
Calculate
Range("O1").Select
Cells.Select
With Selection.Font
.Name = "Calibri"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With Selection.Font
.Name = "Calibri"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Selection.RowHeight = 15
Range("F1").Select
ActiveCell.FormulaR1C1 = "ta"
Range("G1").Select
ActiveCell.FormulaR1C1 = "püd"
Range("H1").Select
ActiveCell.FormulaR1C1 = "kurt"
Range("I1").Select
ActiveCell.FormulaR1C1 = "aks"
Columns("F:I").Select
Columns("F:I").EntireColumn.AutoFit
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("J:N").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.ColumnWidth = 8.43
Columns("J:N").EntireColumn.AutoFit
Range("O2").Select
End Sub
Son düzenleme:
