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: 5,302
Default Worksheet_Change Errors

Hi Dave,

*Invariably*, I use the construct:

if intersect(target,me.range("c1")) is nothing then exit sub

I find it easier to extend the range to multiple cells.


I agree, but for once I did vary!

---
Regards,
Norman



"Dave Peterson" wrote in message
...
I think you meant:

If Target.Address = "$C$1" Then
or
If Target.Address(0,0) = "C1" Then

I like this style:

if intersect(target,me.range("c1")) is nothing then exit sub

I find it easier to extend the range to multiple cells.



Norman Jones wrote:

Hi Deana,

If Target = Range("C1") Then


This line is not doing what you expect it to; it compares the target to
the
value of C1.

Therefore, if you copy/drag to a multicell range, the sub will error
because
a multicell range does not have a value property

Try instead:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Address = "C1" Then
Call FindSheet
End If
End Sub

---
Regards,
Norman

"deanayoung"
wrote
in message
...

Hi Experts,

I need your help (please!). I'm fairly new to this, so apologies for
the dumb questions.

I'm using the same Worksheet_Change macro on several different sheets,
to call a different macro, which is saved on a general module sheet.

It should be fairly simple, when a particular cell changes, then it
calls the macro.

The exact code is:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = Range("C1") Then
Call FindSheet
End If
End Sub

The macro runs fine but if I drag and drop a completely unrelated
formula anywhere on the same sheet, I get the following error message:

Run-time error 13. Type Mismatch.

Any ideas?

Obviously, any help would be gratefully recieved!

Thanks

Dean


--
deanayoung
------------------------------------------------------------------------
deanayoung's Profile:
http://www.excelforum.com/member.php...o&userid=24939
View this thread:
http://www.excelforum.com/showthread...hreadid=384758


--

Dave Peterson





 
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
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Worksheet_Change DDE Johan de Kok Excel Programming 2 April 23rd 05 06:32 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 11:36 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"