I made a cell as a button so when the cell is clicked, a piece of code is run. The code looks like the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$O$1" Then
do something...
It worked fine. I then merged cells N1, O1, P1 but the code no longer works. I tried something like:
If Target.Address = range("N1:P1")
It did not work.
What should I do to make it work? Thanks.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$O$1" Then
do something...
It worked fine. I then merged cells N1, O1, P1 but the code no longer works. I tried something like:
If Target.Address = range("N1:P1")
It did not work.
What should I do to make it work? Thanks.