Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code error N.F[_2_] Excel Discussion (Misc queries) 1 July 2nd 07 11:13 PM
Error in code JOUIOUI Excel Programming 4 June 13th 06 02:13 AM
Error in code SHIPP Excel Programming 3 December 30th 05 10:41 PM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"