LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default how to prevent code running when in a worksheet code

thanks again for the reply.
My problem is that the macro I am trying to run, but needs to stop this
code,
simply selects the entire range (c8:r20) and clears the cells.

As there is no actual value to enter I am a little lost to entering this
into the code???

Corey....


"Carim" wrote in message
oups.com...
Hi Corey,

I think I did not express myself clearly enough ...
With a test of your own ...
say if there is the number 1 in cell A1 then nothing happens,
otherwise your macro is executed ...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRange As Range

If Range("A1").Value = 1 Then
Exit Sub
Else
If Not Intersect(Target, Range("C8:R30")) Is Nothing Then
Call frmCalendar.Show
End If
End If

End Sub

Hope this clarifies
Cheers
Carim





 
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
Prevent code in "Sheet Activate" from running when sheet made visible from other macr Simon Lloyd[_794_] Excel Programming 10 June 21st 06 09:15 AM
Running VBA Code not written within the currrent worksheet DMB Excel Programming 2 September 6th 05 05:58 PM
Worksheet Change code not running when you just delete data in cells. KimberlyC Excel Programming 0 June 23rd 05 01:43 AM
MACRO OR VBA CODE TO PREVENT USERS FROM PRINTING THE CONTENTS OF A WORKSHEET? Marcello do Guzman Excel Programming 1 November 8th 03 12:34 AM
Running Code in an XLA from a Worksheet Chrissy[_4_] Excel Programming 6 October 11th 03 11:27 PM


All times are GMT +1. The time now is 01:18 PM.

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

About Us

"It's about Microsoft Excel"