如何将 B2 列添加到 E2 并将其放入 F2 列。在这种情况下,这会动态地继续下去,直到 B12 + E12 = F12?
子计算比率()
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(0, 1).FormulaR1C1 = "Others #Dev/#Deals"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).FormulaR1C1 = "=Iferror(RC[-8]/RC[-7],0)"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).AutoFill Destination:=oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight).Offset(0, 1))
oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight)).Copy
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks:=False, Transpose:=False
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(0, 1).FormulaR1C1 = "Country/Area #Dev/#Deals"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).FormulaR1C1 = "=Iferror(RC[-7]/RC[-6],0)"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).AutoFill Destination:=oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight).Offset(0, 1))
oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight)).Copy
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks:=False, Transpose:=False
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(0, 1).FormulaR1C1 = "Geo #Dev/#Deals"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).FormulaR1C1 = "=Iferror(RC[-6]/RC[-5],0)"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).AutoFill Destination:=oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight).Offset(0, 1))
oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight)).Copy
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks:=False, Transpose:=False
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(0, 1).FormulaR1C1 = "Corporate #Dev/#Deals"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).FormulaR1C1 = "=Iferror(RC[-5]/RC[-4],0)"
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).AutoFill Destination:=oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight).Offset(0, 1))
oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight)).Copy
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks:=False, Transpose:=False
oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(0, 1).FormulaR1C1 = "Total # Of Deals Per Level"
'oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).FormulaR1C1 = "=SUM(B2:E2)"
' oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0).AutoFill Destination:=oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight).Offset(1, 0), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight).Offset(0, 1))
' oEXLWB.Sheets("Country").Range(oEXLWB.Sheets("Country").Range("A1").End(xlToRight), oEXLWB.Sheets("Country").Range("A1").End(xlDown).End(xlToRight)).Copy
' oEXLWB.Sheets("Country").Range("A1").End(xlToRight).PasteSpecial Paste:=xlPasteValues, operation:=xlNone, SkipBlanks:=False, Transpose:=False
oEXLWB.Sheets("Country").Range("B:I").Delete
oEXLWB.Sheets("ExportDeviations").Columns(oEXLWB.Sheets("ExportDeviations").Range("A4").End(xlToRight).Column).Delete
End Sub