Sumeluar
Active Member
- Joined
- Jun 21, 2006
- Messages
- 274
- Office Version
- 365
- 2016
- 2010
- Platform
- Windows
- MacOS
- Mobile
Good day - I have a code that needs tweaking for it to work as I intend it to, since I am very green when it comes to coding, I am asking for your assistance.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Database").Columns(2)) Is Nothing Then
If (Target.Value) = "N" And (Target.Offset(0, 1)) > "" Then
Target.Offset(0, 5).Value = "Not Started"
Else
Target.Offset(0, 5).Value = ""
End If
End If
En sub
What I am after is the following: From a named range "Database" I want column 5 to populate with "Not started" if column 2 equals "N" and column 3 contains text, I have tried many different ways and it works randomly backwards, if I type some text on column 3 and go back to column 2 it seems to work which is not the results I am looking for. Basically, I need both conditions to be true to populate column 5.
I appreciate beforehand any input or ideas.
Best regards!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Database").Columns(2)) Is Nothing Then
If (Target.Value) = "N" And (Target.Offset(0, 1)) > "" Then
Target.Offset(0, 5).Value = "Not Started"
Else
Target.Offset(0, 5).Value = ""
End If
End If
En sub
What I am after is the following: From a named range "Database" I want column 5 to populate with "Not started" if column 2 equals "N" and column 3 contains text, I have tried many different ways and it works randomly backwards, if I type some text on column 3 and go back to column 2 it seems to work which is not the results I am looking for. Basically, I need both conditions to be true to populate column 5.
I appreciate beforehand any input or ideas.
Best regards!