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
<tbody>
</tbody>
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
Lot | Date |
15 | 9-Nov-2014 |
15 | 9-Nov-2014 |
2 | 10-Okt-2014 |
5 | 20-Okt-2014 |
<tbody>
</tbody>
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