Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
error in code help
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRange As Range Set MyRange = B8: R30 <==== I am getting an error here WHY?? If Not Application.Intersect(Target, MyRange) Is Nothing Then Call OpenCalendar End Sub -- Regards Corey |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
error in code help
Corey wrote: Sub Worksheet_SelectionChange(ByVal Target As Range) Dim MyRange As Range Set MyRange = B8: R30 <==== I am getting an error here WHY?? If Not Application.Intersect(Target, MyRange) Is Nothing Then Call OpenCalendar End Sub -- Regards Corey The way you have this typed, you are setting the Range Object, MyRange, equal to a string: "B8:R30". What you want to do is set MyRange equal to another Range Object. That is done like this: Set MyRange=Range("B8:R30") Hope that explains it, I had a hard time learning that when I first started. Asta-La-Seeya..... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code error | Excel Discussion (Misc queries) | |||
Error in code | Excel Programming | |||
Error in code | Excel Programming | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |