wwisconsin1
New Member
- Joined
- Dec 28, 2022
- Messages
- 2
- Office Version
- 2010
- Platform
- Windows
I want to activate some code when a particular cell is selected.
I found this code below from Teylan in New Zealand posted in 2013.
When I put this code in the sheet module it works perfectly. Thankyou Teylan.
But instead of cell D4 as the activation cell, I want to use merged cells D4 and D5 as the activation cell.
I tried changing the code line to this:
(Target, Range("D4:D5")) but it doesn't work. Any suggestions would be appreciated.
Thank you
'''Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("D4")) Is Nothing Then
Application.Calculate
End If
End If
End Sub'''
I found this code below from Teylan in New Zealand posted in 2013.
When I put this code in the sheet module it works perfectly. Thankyou Teylan.
But instead of cell D4 as the activation cell, I want to use merged cells D4 and D5 as the activation cell.
I tried changing the code line to this:
(Target, Range("D4:D5")) but it doesn't work. Any suggestions would be appreciated.
Thank you
'''Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then
If Not Intersect(Target, Range("D4")) Is Nothing Then
Application.Calculate
End If
End If
End Sub'''