1.要在vba設條件,請問每個月的第2個禮拜一要怎麼寫
2.
Sub aaa()
For i = 549 To Worksheets("sheet1").Range("A1").End(xlDown).Row
If Cells(i, 10) > Cells(i, 11) Then
Set x = Cells(i, 8)
Do Until Cells(i, 10) < Cells(i, 11) '紅色的i可以先加1嗎?也就是上面如果求出的i是5,這邊直接先代6,後面再每次以1增加,如果改成Do Until Cells(i+1, 10) < Cells(i, 11)這樣好像每次都增加2?
i = i + 1
Loop
Set y = Cells(i, 8)
x.Offset(, 23) = y - x
End If
Next
End Sub
謝謝各位~~~ |