|
- Sub 求单个体积()
- Dim A As Range
- Dim B As Range
- Dim C As Range
- Dim D As Range
- Dim x As Integer
- Set A = Sheets("仓储费").Rows(1).Find("单个体积", , , xlWhole)
- If A Is Nothing Then MsgBox "找不到 指定名称": Exit Sub
-
- Set B = Sheets("仓储费").Rows(1).Find("长", , , xlWhole)
- Set C = Sheets("仓储费").Rows(1).Find("宽", , , xlWhole)
- Set D = Sheets("仓储费").Rows(1).Find("高", , , xlWhole)
- ' For x = 10000 To 2 Step -1
- ' Range("A" & x) = Range("B" & x) * Range("C" & x) * Range("D" & x)
- ' Next x
- For x = 1 To 19885
- A.Offset(x, 0) = B.Offset(x, 0).Value * C.Offset(x, 0).Value * D.Offset(x, 0).Value
- Next x
- Set A = Nothing
- Set B = Nothing
- Set C = Nothing
- Set D = Nothing
- End Sub
复制代码 |
|