- Katılım
- 29 Ekim 2011
- Mesajlar
- 138
- Excel Vers. ve Dili
- 2007 türkçe
Merhaba,
bir çalışma kitabının içinde birden çok sayfa (01,02,03,30,31 kadar) var elimde olan makroyu çalıştırdığımda sadece o sayfada hesaplama yapıyor ben aynı anda tüm sayfalarda aynı makroyu çalıştırsın istiyorum nasıl yapabilirim?
Teşekkürler,
bir çalışma kitabının içinde birden çok sayfa (01,02,03,30,31 kadar) var elimde olan makroyu çalıştırdığımda sadece o sayfada hesaplama yapıyor ben aynı anda tüm sayfalarda aynı makroyu çalıştırsın istiyorum nasıl yapabilirim?
Teşekkürler,
Kod:
Sub haftalık_rapor()
'
' Makro4 Makro
'
'
Range("S4").Select
ActiveCell.FormulaR1C1 = "CNC"
Range("S5").Select
ActiveCell.FormulaR1C1 = "PUR ROBOT"
Range("S6").Select
ActiveCell.FormulaR1C1 = "HAM ZIMPARA"
Range("S7").Select
ActiveCell.FormulaR1C1 = "PRES"
Range("S8").Select
ActiveCell.FormulaR1C1 = "BOYAHANE"
Range("S9").Select
ActiveCell.FormulaR1C1 = "POLYESTER ZIMP."
Range("S10").Select
ActiveCell.FormulaR1C1 = "POLİSAJ"
Range("S11").Select
ActiveCell.FormulaR1C1 = "KALİTE"
Range("S12").Select
ActiveCell.FormulaR1C1 = "KARBON"
Range("S13").Select
ActiveCell.FormulaR1C1 = "PUR"
Range("S14").Select
ActiveCell.FormulaR1C1 = "BAKIM"
Range("S15").Select
ActiveCell.FormulaR1C1 = "İDARİ"
Range("S16").Select
ActiveCell.FormulaR1C1 = "KALIPHANE"
Range("S17").Select
ActiveCell.FormulaR1C1 = "ÜRETİM LOJİSTİK"
Range("T17").Select
Columns("S:S").EntireColumn.AutoFit
Range("T2").Select
ActiveCell.FormulaR1C1 = "PERS.SAY."
Range("U2").Select
ActiveCell.FormulaR1C1 = "NÇ SAAT"
Range("V2").Select
ActiveCell.FormulaR1C1 = "FM1 SAAT"
Range("W2").Select
ActiveCell.FormulaR1C1 = "FM2 SAAT"
Range("X3").Select
ActiveCell.FormulaR1C1 = "Ö"
Range("Y3").Select
ActiveCell.FormulaR1C1 = "D"
Range("Z3").Select
ActiveCell.FormulaR1C1 = "E"
Range("AA3").Select
ActiveCell.FormulaR1C1 = "S"
Range("AB3").Select
ActiveCell.FormulaR1C1 = "K"
Range("AC3").Select
ActiveCell.FormulaR1C1 = "L"
Range("AD3").Select
ActiveCell.FormulaR1C1 = "Ü"
Range("AE3").Select
ActiveCell.FormulaR1C1 = "R"
Range("AF3").Select
ActiveCell.FormulaR1C1 = "Y"
Range("AG3").Select
Columns("W:W").EntireColumn.AutoFit
Columns("V:V").EntireColumn.AutoFit
Columns("U:U").EntireColumn.AutoFit
Columns("T:T").EntireColumn.AutoFit
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
Range("X2:AE2").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("X2:AE2").Select
ActiveCell.FormulaR1C1 = "DEVAMSIZ"
Range("X2:AF2").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
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("AG2").Select
ActiveCell.FormulaR1C1 = "ÜCRETSİZ SAAT İZİN"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "DİĞER ÜCRETLİ SAAT İZİN"
Range("AI2").Select
ActiveCell.FormulaR1C1 = "SENDİKAL ÜCRETLİ SAAT İZİN"
Range("S2:AK17").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Columns("AG:AG").EntireColumn.AutoFit
Columns("AH:AH").EntireColumn.AutoFit
Columns("AI:AI").EntireColumn.AutoFit
Columns("AJ:AK").Select
Selection.Delete Shift:=xlToLeft
Range("S2:AI2").Select
With Selection
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
With Selection
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
Columns("AG:AG").ColumnWidth = 14.43
Columns("AG:AG").ColumnWidth = 12.14
Columns("AG:AG").ColumnWidth = 10.71
Columns("AH:AH").ColumnWidth = 13.29
Columns("AI:AI").ColumnWidth = 17.86
Columns("AI:AI").ColumnWidth = 17.29
Range("X3:AF3").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("S2:AI2").Select
Selection.Font.Bold = True
Range("S3:S17").Select
Selection.Font.Bold = True
Range("U8").Select
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
Range("X3:AF3").Select
Selection.Font.Bold = True
Range("T4").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R4C2:R500C2,RC19)"
Range("T4").Select
Selection.AutoFill Destination:=Range("T4:T17")
Range("T4:T17").Select
Range("U4").Select
ActiveCell.FormulaR1C1 = _
"=SUMIF(R4C2:R500C2,RC19,OFFSET(R4C1,,MATCH(R2C,R2C1:R2C17,0)-1,ROWS(R4C2:R500C2),1))"
Range("U4").Select
Selection.AutoFill Destination:=Range("U4:U17")
Range("U4:U17").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
Selection.AutoFill Destination:=Range("U4:W17"), Type:=xlFillDefault
Range("U4:W17").Select
Range("X4").Select
ActiveCell.FormulaR1C1 = _
"=COUNTIFS(R4C2:R500C2,RC19,OFFSET(R4C1,,MATCH(R2C24,R2C1:R2C17,0)-1,ROWS(R4C2:R500C2),1),R3C)*7.5"
Range("X4").Select
Selection.AutoFill Destination:=Range("X4:X17")
Range("X4:X17").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 16
Selection.AutoFill Destination:=Range("X4:AE17"), Type:=xlFillDefault
Range("X4:AE17").Select
Range("AE4").Select
Selection.AutoFill Destination:=Range("AE4:AF4"), Type:=xlFillDefault
Range("AE4:AF4").Select
Range("AF4").Select
ActiveCell.FormulaR1C1 = _
"=COUNTIFS(R4C2:R500C2,RC19,OFFSET(R4C1,,MATCH(R2C24,R2C1:R2C17,0)-1,ROWS(R4C2:R500C2),1),R3C)*7.5+COUNTIFS(R4C2:R500C2,RC19,OFFSET(R4C1,,MATCH(R2C24,R2C1:R2C17,0)-1,ROWS(R4C2:R500C2),1),""TUTANAK"")*7.5"
Range("AF4").Select
Selection.AutoFill Destination:=Range("AF4:AF17")
Range("AF4:AF17").Select
Range("U4").Select
Selection.Copy
Range("AG4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("AG4:AG17")
Range("AG4:AG17").Select
Selection.AutoFill Destination:=Range("AG4:AI17"), Type:=xlFillDefault
Range("AG4:AI17").Select
Range("T4:AI17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("T18").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=SUM(R[-14]C:R[-1]C)"
Range("T18").Select
Selection.AutoFill Destination:=Range("T18:AI18"), Type:=xlFillDefault
Range("T18:AI18").Select
Selection.Font.Bold = True
Range("AK4").Select
ActiveCell.FormulaR1C1 = "Ücretsiz izin"
Range("AL4").Select
Columns("AK:AK").EntireColumn.AutoFit
Range("AK5").Select
ActiveCell.FormulaR1C1 = "Rapor"
Range("AK6").Select
ActiveCell.FormulaR1C1 = "Yıllık izin"
Range("AK7").Select
ActiveCell.FormulaR1C1 = "Vizite"
Range("AK8").Select
ActiveCell.FormulaR1C1 = "Görevli"
Range("AK9").Select
ActiveCell.FormulaR1C1 = "Ücretsiz izin"
Range("AL9").Select
Columns("AK:AK").ColumnWidth = 10.43
Columns("AK:AK").EntireColumn.AutoFit
Range("AL4").Select
ActiveCell.FormulaR1C1 = "=R[14]C[-5]+R[14]C[-8]+R[14]C[-6]"
Range("AL5").Select
ActiveCell.FormulaR1C1 = "=R[13]C[-7]"
Range("AL6").Select
ActiveCell.FormulaR1C1 = "=R[12]C[-11]"
Range("AL7").Select
ActiveCell.FormulaR1C1 = "0"
Range("AL8").Select
ActiveCell.FormulaR1C1 = "0"
Range("AK9").Select
ActiveCell.FormulaR1C1 = "Ücretli izin"
Range("AL9").Select
ActiveCell.FormulaR1C1 = _
"=R[9]C[-14]+R[9]C[-13]+R[9]C[-12]+R[9]C[-10]+R[9]C[-9]+R[9]C[-4]+R[9]C[-3]"
Range("AK4:AL9").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("AM12").Select
End Sub
