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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

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