PDA

View Full Version : Maybe a Null question?



freaknyea
06-27-2008, 09:31 AM
Okay, here is what I have...

In Column B, I enter information.
When information is entered into Column B then Column F populates with a date.

What I am having a problem with is the following:

I want,

When F populates with a date then G will populate with a date.
I also want it so that when G populates, then it can no longer be updated and stays exactly the same.
So F can update, but not G. G populates once.
Another issue I have is G will only populate if I manually enter something into F. I would prefer if G populates when F autopopulates.

Thank you.




Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([B:B], Target) Is Nothing Then
Application.EnableEvents = False
Cells(Target.Row, 6) = Now
Application.EnableEvents = True
End If
If Not Intersect([F:F], Target) Is Nothing Then
Application.EnableEvents = False
Cells(Target.Row, 7) = Now
Application.EnableEvents = True
End If
End Sub

Ago
06-27-2008, 10:53 AM
if you populate both F and G at the same time (intersect B:B) wouldnt that mean that you can modify F without G changing?




Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([B:B], Target) Is Nothing Then
Application.EnableEvents = False
Cells(Target.Row, 6) = Now
Cells(Target.Row, 7) = Now
Application.EnableEvents = True
End If
End Sub




or do you need to be able to change B without G changing?

freaknyea
06-27-2008, 11:13 AM
Be able to change B without G changing.

Ago
06-27-2008, 11:17 AM
try this.




Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([B:B], Target) Is Nothing Then
Application.EnableEvents = False
Cells(Target.Row, 6) = Now
If Range("G" & Target.Row).Value = "" Then
Cells(Target.Row, 7) = Now
End If
Application.EnableEvents = True
End If
End Sub

freaknyea
06-27-2008, 01:58 PM
Thanks. That worked. I will have to see when a new date populates on Monday, though. So far so good.