セル(4、 "D")とセル(6、 "D")の乗算に基づいて作成される1つのダイナミックテーブルがあります。行。列番号は固定され、BからGまで定義されます。データの最初の行は13行目です。ダイナミックレンジを使用して数式で複数のセルをオートフィルする方法
列BにdeltaMassFormula = D13 *(G13〜F13)を導入する式deltaMassFormulaを記述します。
E14 = D14 * - 乗算= 4次に
E13 = D13×(F13 G13)場合COUNTROWSは、例えば行の総数(乗算変数)
に等しくなるまで自動的にダウン充填します(G14-F14)
E15 = D15の*(G15 - F15)
E16 = D16の*(G16 - F16)
マイコード:
Dim StartCellM As Range
Dim lastRow As Long
Dim deltaMassFormula As Integer
Dim multiplication As Integer
multiplication = Cells(4, "D").Value * Cells(6, "D").Value
countRows = multiplication - 1
Set StartCellM = Cells(13, "E")
Set lastRow = Cells(13, "E") + countRows
deltaMassFormula = Cells(13, "D") * (Cells(13, "G") - Cells(13, "F"))
With ThisWorkbook.Sheets(1)
.Range("E13").Formula = deltaMassFormula
.Range("E13:E" & lastRow).FillDown
End With
誰もが私を助けることができますか?
あなたが投稿したコードで発生しますどのような問題? –
問題は、コードがE13以下のセルを埋めるものではないということです。 – vbalearner