|
おそらく、こうでしょうか。
Option Explicit
Sub 抽出月()
Dim 終行 As Long
Application.ScreenUpdating = False
Range("B7:R35").ClearContents
Range("T6:Z400").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Range("GG1:GI2"), _
Unique:=True
Range("T6:Z400").Copy
Range("B6").PasteSpecial Paste:=xlPasteValues
ActiveSheet.ShowAllData
終行 = Range("b36").End(xlUp).Row
Range("B6:H" & 終行).Sort _
Key1:=Range("B6"), _
Order1:=xlAscending, _
Header:=xlYes
Range("i7:i" & 終行).Formula = "=Sum(E7:H7)"
Range("n7:r" & 終行).FormulaR1C1 = "=ROUNDDOWN(RC[-9]/RC4,1)"
' ↑がわかりにくければ、かわりに↓
' Range("n7:n" & 終行).Formula = "=ROUNDdown(E7/D7,1)"
' Range("o7:o" & 終行).Formula = "=ROUNDdown(F7/D7,1)"
' Range("p7:p" & 終行).Formula = "=ROUNDdown(G7/D7,1)"
' Range("q7:q" & 終行).Formula = "=ROUNDdown(H7/D7,1)"
' Range("r7:r" & 終行).Formula = "=ROUNDdown(I7/D7,1)"
Range("b7", "d" & 終行).Copy
Range("k7").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Range("r4").Select
Application.ScreenUpdating = True
End Sub
|
|