本帖最后由 雄鹰 于 2011-12-15 08:59 编辑
还有点问题,每天运行一次就可以。
Sub 改变()
Dim 序号列(1 To 46) As Double
a = 1
b = Format(Now(), "0.0")
Dim rng As Range
Dim what As String
what = "天"
For i = 1 To [c65536].End(xlUp).Row
Cells(i, 3).Replace "天", ""
Next
what = "'"
For i = 1 To [c65536].End(xlUp).Row
Cells(i, 3).Replace "'", ""
Next
For i = 3 To Cells.Find("*", , , , 2, 2).Column
If Cells(2, i) = "库存" Then
序号列(a) = i
a = a + 1
End If
Next
a = 1
Do
j = 序号列(a)
For i = 3 To [i65536].End(xlUp).Row
k = j - 2
100:
c = Format(Cells(i, 3) + Cells(1, k), "0.0")
If c > b Then
Cells(i, j).Interior.ColorIndex = 4 '单元格值等于6时,该单元格填充红色
Else
Cells(i, j).Interior.ColorIndex = 3 '单元格值等于6时,该单元格填充红色
End If
Next
a = a + 1
Loop
End Sub
二品牌库存管理 12自动提醒.zip
(76.37 KB, 下载次数: 11)
|