Reputation: 137
It is impossible for me to solve this, im at my boiling points upper limit, so i could really use your directions or help. I've attached an image in the header. I need a vba macro to update / change the values in column E ( Ve Planning ) with the following contitions:
Then update the column E value for Operation = SUDURA with column E value for operation LASER + 10 days.
I dont know if you understand this mess, but if you do, any help greatly appreciated.
Thanks alot!
Upvotes: 2
Views: 6919
Reputation: 33682
Try the short code below, it worked in my test with limited Data records. Let me know if it works on your data as well.
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
Upvotes: 1