我有两个范围如下
Dim onedl, twodl As Range
Dim lastrow as long
Set oned1 = xl.ThisWorkbook.Sheets(1).Range("C5:C" & lastrow)
Set twod1 = xl.ThisWorkbook.Sheets(1).Range("F5:F" & lastrow)
lastrow = xl.ThisWorkbook.Sheets(1).Cells(Rows.Count, 2).End(xlUp).Row
我可以减去两个范围并计算 Range("I5:I" & lastrow) 中的值,类似于 (twod1 - oned1) 来填充。