If not Intersect(Target,Range("E11,H11,.........)) is nothing then

pincivma

Board Regular
Joined
Dec 12, 2004
Messages
206
Hi there

This should be an easy solve but I'm getting errors.

Here is a partial code that I got from the internet

If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E11,H11,E482,H482,E953,H953.....")) Is Nothing Then 'Change this to any cell (or cells) you would like to have the Pop-Up Calendar Appear
CheckForSheet
CalendarShow
Else:
CheckForSheet
CalendarHide
End If
End Sub

I have over 200 cells in the If Not Intersect(Target, Range("E11,H11,E482,H482,E953,H953........")) Is Nothing code. My question is this: I can put all the 200 plus cells in the Range("E11,H11,E482,H482,E953,H953........") but then it would be a very, very long line. Is there way to go on a second and third or fourth line so that I could not loose track of all the cells I have to put in?

Thanks
 
Is there any other way to identify which rows you want the calendar to pop up for?

For example, in the same row is there a particular value?

e.g. in each row you want the calendar to pop in there's the word 'CALENDAR' in column A?

If there was something like that you could use something like this:
Code:
If (Target.Column = 5 Or Target.Column = 8) And Cells(Target.Row, "A").Value = "CALENDAR" Then
    CheckForSheet
    CalendarShow
Else
    CheckForSheet
    CalendarHide
End If
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Nori

I guess I can put the word Calendar in Column A where I want to calendars to appear and see if that works.
Thanks for the suggestion
 
Upvote 0
Hi Nori, Rory

I did have an identifier in column D called START DATE. I put that into your code and it worked like a charm.

Thank you Nori and Rory for all your help on solving this problem.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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