Making a pop-up form work from a merged cell

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
Hi,

I've used the following code in another workbook to open a calander pop up when I choose a particular cell and then once i've selected the date I want to select another cell.

I'm trying to use the same code on another workbook however the cell I want to use to start the pop up is merged with a few others, H2-J2.

What do I have to do to the code to select the merged cells?

Thanks in advance

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If (Target.CountLarge = 1) Then
    If Not Intersect(Target, Range("H2")) Is Nothing Then
    frmCalendar.Show
    Range("A2").Select
    End If
    End If
End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
.
Your code seems to work if you merge only TWO CELLS (H2 & I2). Would that still allow your sheet to
display how you wanted ?
 
Upvote 0
No unfortunately it would give enough space to display how I would like it to. I need to leave the 4 cells, H2:K2 merged.
 
Upvote 0
Can you use

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$H$2:$K$2" Then
        frmCalendar.Show
        Range("A2").Select
    End If
End Sub
?
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top