我也遇到這問題,找過沒解,最後用 VBA 解。
將 "合併儲存" 的資料寫一份到 另一列 .... 分開
既然寫 VBA 那就不必寫 "M行判斷式" ...直接將資訊寫到 M 就好了
以下是我亂搞寫的 ....沒有debug
還可再改精簡點 ....改天再改 .... XD
Sub test()
lr = Cells(1, 6).End(xlDown).Row
B = 0
For xl = 2 To lr
If Cells(xl, 7).MergeCells = True Then
If Not (Cells(xl, 7).Value = "") Then
B = 0
End If
If Cells(xl - B, 7).Value = "DOG" Then
Cells(xl, 13).Value = "V"
B = B + 1
Else
Cells(xl, 13).Value = "X"
B = B + 1
End If
ElseIf Cells(xl, 7).Value = "DOG" Then
Cells(xl, 13).Value = "V"
B = 0
ElseIf Not (Cells(xl, 7).Value = "DOG") Then
Cells(xl, 13).Value = "X"
B = 0
End If
Next xl
End Sub
其他的慢慢改吧 .....