George_ATH
New Member
- Joined
- Nov 2, 2015
- Messages
- 12
Hello,
i want to transorm this type to a vba code so to run it when i want
the type is
IF(DAY(E3)=DAY(EOMONTH(E3;0));IF(F3>TODAY();EOMONTH(E3;1);TODAY());IF(F3>TODAY();DATE(YEAR(F3);MONTH(F3);DAY(F3)+1);TODAY()))
i try this but is not working
If Day(Cells(Selection.Row, 5)) = Day(EoMonth(Cells(Selection.Row, 5), 0)) Then
If today() < Cells(Selection.Row, 6) Then
Range(Cells(Selection.Row, 5)).Value = EoMonth(Cells(Selection.Row, 5), 1)
Else: Range(Cells(Selection.Row, 5)).Value = today()
End If
If today() < Cells(Selection.Row, 6) Then
Range(Cells(Selection.Row, 5)).Value = DateAdd("d", 1, Cells(Selection.Row, 6))
Else: Range(Cells(Selection.Row, 5)).Value = today()
End If
End If
End Sub
i want to transorm this type to a vba code so to run it when i want
the type is
IF(DAY(E3)=DAY(EOMONTH(E3;0));IF(F3>TODAY();EOMONTH(E3;1);TODAY());IF(F3>TODAY();DATE(YEAR(F3);MONTH(F3);DAY(F3)+1);TODAY()))
i try this but is not working
If Day(Cells(Selection.Row, 5)) = Day(EoMonth(Cells(Selection.Row, 5), 0)) Then
If today() < Cells(Selection.Row, 6) Then
Range(Cells(Selection.Row, 5)).Value = EoMonth(Cells(Selection.Row, 5), 1)
Else: Range(Cells(Selection.Row, 5)).Value = today()
End If
If today() < Cells(Selection.Row, 6) Then
Range(Cells(Selection.Row, 5)).Value = DateAdd("d", 1, Cells(Selection.Row, 6))
Else: Range(Cells(Selection.Row, 5)).Value = today()
End If
End If
End Sub