我目前正在尝试从一个持续变化的单元格中获取值。问题是在那个单元格上有一个公式,所以当我编写VBA代码来获取值时,它不会向我显示任何内容。
有没有办法从包含公式的不断变化/更新的单元格中获取每个值?
提前致谢!
Sub all()
Dim p As Integer
Dim o As Integer
Dim Length As Single
Dim Width As Single
Dim Height As Single
Dim sheet As Worksheet
Set sheet = ThisWorkbook.Worksheets("Product Info")
LastRow = sheet.Cells(sheet.Rows.Count, "B").End(xlUp).row
o = 1
For p = 2 To LastRow
Length = Cells(p, 2).Value
Width = Cells(p, 3).Value
Height = Cells(p, 4).Value
Call boxes(Length, Width, Height)
Call boxesLast3(Length, Width, Height)
Total = Range("Q1").Value
ActiveWorkbook.Worksheets("Backend").Cells(o, 26).Value = Total
o = o + 1
Next p
End Sub