Hi, i have recoded some macros & modified some old macros. so i want combine bellow all the macros & need to make one short macro(removing unwanted codes). code should combine as per below , pls help me to do this..
UnMerge rows.
inset new 2 columns
adding two text
add value of two formula result
UnMerge rows.
Code:
Range("A1:M1").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
inset new 2 columns
Code:
Columns("L:M").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
adding two text
Code:
Range("L2").Select
ActiveCell.FormulaR1C1 = "Pend Ord"
Range("M2").Select
ActiveCell.FormulaR1C1 = "Free Stk"
add value of two formula result
Code:
With Range("L3:L" & Range("D" & Rows.Count).End(xlUp).Row)
.FormulaR1C1 = "=SUMIFS(R2C11:R[-1]C[-1],R2C4:R[-1]C[-8],RC[-8],R2C5:R[-1]C[-7],RC[-7],R2C6:R[-1]C[-6],RC[-6],R2C7:R[-1]C[-5],RC[-5],R2C8:R[-1]C[-4],RC[-4],R2C9:R[-1]C[-3],RC[-3])"
.Value = .Value
With Range("M3:M" & Range("D" & Rows.Count).End(xlUp).Row)
.FormulaR1C1 = "=RC[1]-RC[-1]"
.Value = .Value