Thank you everyone in advance for the help. I am still learning basic VBA so this one is a bit of a stretch...
For all cells in column A that are updated (be that manually entered, or updated via click and drag, other) I want a specific output in column B. I have the if statements working as desired when data is manually entered into column A, but any other type of manipulation including mass select and delete fail to update column B.
so rather simple set of code, but what am i missing to enable the click/drag or double click on a cell in column A to update all of the equal number of cells in column B?
Thank you again in advance.
For all cells in column A that are updated (be that manually entered, or updated via click and drag, other) I want a specific output in column B. I have the if statements working as desired when data is manually entered into column A, but any other type of manipulation including mass select and delete fail to update column B.
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
ThisRow = Target.Row
If Range("a" & ThisRow).Value Like "*foo1*" Or Range("a" & ThisRow).Value Like "*foo2*" Then
Range("b" & ThisRow).Value = "OUT1"
Else
If Range("a" & ThisRow).Value Like "*foo3*" Or Range("a" & ThisRow).Value Like "*foo4*" Or Range("a" & ThisRow).Value Like "*foo5*" Then
Range("b" & ThisRow).Value = "OUT2"
Else
If Range("a" & ThisRow).Value Like "*foo6*" Or Range("a" & ThisRow).Value Like "*foo7*" Or Range("a" & ThisRow).Value Like "*foo8*" Or Range("a" & ThisRow).Value Like "*f0016*" Then
Range("b" & ThisRow).Value = "OUT3"
Else
If Range("a" & ThisRow).Value Like "*foo9*" Or Range("a" & ThisRow).Value Like "*foo10*" Or Range("a" & ThisRow).Value Like "*foo11*" Or Range("a" & ThisRow).Value Like "*foo17*" Then
Range("b" & ThisRow).Value = "OUT4"
Else
If Range("a" & ThisRow).Value Like "*foo12*" Then
Range("b" & ThisRow).Value = "OUT5"
Else
If Range("a" & ThisRow).Value Like "*foo13*" Or Range("a" & ThisRow).Value Like "*foo14*" Or Range("a" & ThisRow).Value Like "*foo15*" Then
Range("b" & ThisRow).Value = "OUT6"
Else
If IsEmpty(Range("a" & ThisRow).Value) Then
Range("b" & ThisRow).Value = ""
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
so rather simple set of code, but what am i missing to enable the click/drag or double click on a cell in column A to update all of the equal number of cells in column B?
Thank you again in advance.