|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
发出不来?
- Sub TZ_20180820()
- Dim t
- Dim arr
- Dim i, j
- Dim yf_Qty As Double
- Dim yfz_Qty As Double
- Dim sf_Qty As Double
- Dim sfz_Qty As Double
- t = Timer
- arr = Sheet1.UsedRange
- i = 2
- Do While i <= UBound(arr)
- yfz_Qty = arr(i, 8) '应发总数量
- sfz_Qty = arr(i, 9) '实发总数量
- yf_Qty = arr(i, 7) '应发数量
- sf_Qty = arr(i, 10) '实发数量
- If sfz_Qty > yfz_Qty Then j = 11 Else j = 12
- arr(i, j) = Abs(sf_Qty - yf_Qty)
- i = i + 1
- Loop
- Sheet2.[A1].Resize(UBound(arr), UBound(arr, 2)) = arr
- Debug.Print Timer - t
- End Sub
复制代码 |
|