Hey there guys,
I am trying to get this worksheet_Change to work correctly for what I need. I am pretty tired so I am probably not thinking straight.
I have a drop-down list in column F, known as Status, it allows me to select a Pending, Pass, Fail, or leave the cell blank as the input. In column G, known as Date Completed, I am trying to input a date automatically when the contents of column F are changed to either Pass or Fail.
I can get a date in G if anything in column F changes, but I only want it to show the date when column F is either Pass or Fail. I just can't seem to get it. Too many long nights and not enough sleep lately.
Here is the code I am using:
I thought that I had it when I tried:
But that was a no go.
Any thoughts or advise to point me in the right direction?
Thank you everyone!
I am trying to get this worksheet_Change to work correctly for what I need. I am pretty tired so I am probably not thinking straight.
I have a drop-down list in column F, known as Status, it allows me to select a Pending, Pass, Fail, or leave the cell blank as the input. In column G, known as Date Completed, I am trying to input a date automatically when the contents of column F are changed to either Pass or Fail.
I can get a date in G if anything in column F changes, but I only want it to show the date when column F is either Pass or Fail. I just can't seem to get it. Too many long nights and not enough sleep lately.
Here is the code I am using:
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range) If (Target.Count = 6) And _
(Not Intersect(Target, [G:G]) Is Nothing) Then _
Target.Offset(0, 1) = Date
End Sub
I thought that I had it when I tried:
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range) If (Target.Count = 6) And _
(Target = "Pass" OR Target = "Fail") And _
(Not Intersect(Target, [G:G]) Is Nothing) Then _
Target.Offset(0, 1) = Date
End Sub
But that was a no go.
Any thoughts or advise to point me in the right direction?
Thank you everyone!