One way:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim bValid As Boolean
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
If IsNumeric(.Value) Then _
If .Value = 1 Then _
bValid = True
With .Offset(0, 1)
If bValid Then
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
Else
.NumberFormat = "General"
.Value = "NA"
End If
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
> The solution you gave me is working. thanks a lot.
>
[quoted text clipped - 5 lines]
> digit is should show "NA".
> if you can give me a solution for that I will be very thankful.
sike11 - 20 Apr 2007 12:15 GMT
Hi JE,
Would this still work if it is a full column as the range rather than a
specified range - i.e G:G instead of G2:G10?
I am also getting an additional error of "Argument not optional". Any
thoughts on this?
Thanks in advance.
>One way:
>
[quoted text clipped - 30 lines]
>> digit is should show "NA".
>> if you can give me a solution for that I will be very thankful.