VBA Excelmacros根据多个条件更新单元格值

我不可能解决这个问题,即时在我的沸点上限,所以我可以真正使用你的指导或帮助。 我在标题中附加了一个图像。 我需要一个vbamacros来更新/更改列E(Ve计划)中的值,并具有以下的接口:

  1. D列必须是空白的。
  2. 必须只更新列A中相同的值
  3. 列I(操作)= LASER。
  4. 如果列F(W NO)值相等。

然后用操作LASER + 10天的E列值更新Operation = SUDURA的E列值。

在这里输入图像说明

我不知道你是否理解这个混乱,但如果你这样做,任何帮助不胜感激。

非常感谢!

尝试下面的短代码,它在我的testing中有限的数据logging工作。 让我知道它是否也适用于您的数据。

Sub UpdateVEPlanning() Dim sht As Worksheet Dim LastRow, lRow As Long ' modify "Sheet1" to whatever worksheet name you have Set sht = ThisWorkbook.Worksheets("Sheet1") ' find last row in sheet with data LastRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).row For lRow = 2 To LastRow If sht.Cells(lRow, 1) = sht.Cells(lRow - 1, 1) Then If Not (sht.Cells(lRow, 9).Find("SUDURA") Is Nothing) And (IsEmpty(sht.Cells(lRow, 4).Value2) Or sht.Cells(lRow, 4).Value2 <= 0) Then If sht.Cells(lRow, 6) = sht.Cells(lRow - 1, 6) Then sht.Cells(lRow, 5) = sht.Cells(lRow - 1, 5) + 10 End If End If End If Next End Sub