Dear
I'm working with a macro (contributed by a colleague on the forum) that inserts a line below whenever the answer is PC or NC.
====
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("V:V")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
If Target.Column <> 22 Or Target.Text <> "NC" And Target.Text <> "PC" Then Exit Sub
Rows(Target.Row + 1).Insert
Cells(Target.Row + 1, 23).Resize(, 42).Merge
Cells(Target.Row + 1, 23).Select
Cells(Target.Row + 1, 22).ClearContents
End Sub
====
How should be
--------------------
Block 1
---------------------
Question 1 = C
Question 2 = NC (Since the answer was NC, insert a line below question 2)
Question 3 = C
Question 4 = C
Question 5 = PC (Since the answer was PC, insert a line below question 5)
(As PC or NC answers appeared in this block, insert one more line below question 5)
---------------------
Block 2
---------------------
Question 1 = C
Question 2 = C
Question 3 = NC (Since the answer was NC, insert a line below question 3)
(As PC or NC answers appeared in this block, insert one more line below question 3)
---------------------
Block 3
---------------------
Question 1 = C
Question 2 = PC (Since the answer was PC, insert a line below question 2)
Question 3 = C
Question 4 = C
(As PC or NC answers appeared in this block, insert a line below question 4)
Bookmarks