galihsaputra
New Member
- Joined
- Nov 6, 2014
- Messages
- 3
Hello Master,
I am newbie and starting new new create macro excel. I have problem in my VBA in excel, this is my sheet excel
[TABLE="width: 500"]
<tbody>[TR]
[TD]Lot[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]9-Nov-2014[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]9-Nov-2014[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]10-Okt-2014[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]20-Okt-2014[/TD]
[/TR]
</tbody>[/TABLE]
And this my code vba
Sub reminder()
For Each cell In Range("B7:B1994")
If cell.Value = Date + 3 Then
Cells(3, 2).Interior.ColorIndex = 4
Cells(3, 2).Font.ColorIndex = 0
Range("B3").Value = cell.Value
ElseIf cell.Value < Date + 3 Or cell.Value > Date + 3 Then
Cells(3, 2).Interior.ColorIndex = 0
Cells(3, 2).Font.ColorIndex = 0
Range("B3").Value = ""
End If
Next
On Error Resume Next
End Sub
when i click command button , I want show Date Today=Date+3 from coloum Date
Actually, it almost success but if I marking "ElseIF", but if i open marking "ElseIF"
this will looping as many total of coloum
I am newbie and starting new new create macro excel. I have problem in my VBA in excel, this is my sheet excel
[TABLE="width: 500"]
<tbody>[TR]
[TD]Lot[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]9-Nov-2014[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]9-Nov-2014[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]10-Okt-2014[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]20-Okt-2014[/TD]
[/TR]
</tbody>[/TABLE]
And this my code vba
Sub reminder()
For Each cell In Range("B7:B1994")
If cell.Value = Date + 3 Then
Cells(3, 2).Interior.ColorIndex = 4
Cells(3, 2).Font.ColorIndex = 0
Range("B3").Value = cell.Value
ElseIf cell.Value < Date + 3 Or cell.Value > Date + 3 Then
Cells(3, 2).Interior.ColorIndex = 0
Cells(3, 2).Font.ColorIndex = 0
Range("B3").Value = ""
End If
Next
On Error Resume Next
End Sub
when i click command button , I want show Date Today=Date+3 from coloum Date
Actually, it almost success but if I marking "ElseIF", but if i open marking "ElseIF"
this will looping as many total of coloum