Making a pop-up form work from a merged cell

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
77
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
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,909
.
Your code seems to work if you merge only TWO CELLS (H2 & I2). Would that still allow your sheet to
display how you wanted ?
 

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
77
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.
 

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
441
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
?
 

Forum statistics

Threads
1,078,437
Messages
5,340,280
Members
399,363
Latest member
farhan11941234

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top