Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Worksheet change sub procedure

Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't use
it like Target.value or iMyInteger = RcCell Is Target or
anything that would require an Object type.

Any ideas?

Grant.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Worksheet change sub procedure

Grant,

The Target argument is indeed a range reference. What exactly do
you mean when you say you can't "use it"?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grant" wrote in message
...
Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't use
it like Target.value or iMyInteger = RcCell Is Target or
anything that would require an Object type.

Any ideas?

Grant.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Worksheet change sub procedure

Type mismatch error for msgbox Target.value

-----Original Message-----
Grant,

The Target argument is indeed a range reference. What

exactly do
you mean when you say you can't "use it"?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grant" wrote in

message
...
Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't

use
it like Target.value or iMyInteger = RcCell Is Target

or
anything that would require an Object type.

Any ideas?

Grant.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Worksheet change sub procedure

Hi Grant,

I could reproduce your situation with an unintentional error entry (e.g.
=25/0) or an intentional error entry such as =NA().

In these special situations what value can the sub return other than a
run-time error?

The following should demonstrate Target.Value does return the value of the
Target range object if there is a legitimate value to return and does return
the address of the Target range irrespective of the Target entry. This is
consistent with Target being a range object.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not IsError(Target.Value) Then
MsgBox Target.Value
End If
MsgBox Target.Address
End Sub

At the risk of overkill, Activecell is clearly a range object but try this
and see what happens:

Sub Tester()
ActiveCell.Value = 25 / 0
MsgBox ActiveCell.Value
End Sub

---
Regards,
Norman



"Grant" wrote in message
...
Type mismatch error for msgbox Target.value

-----Original Message-----
Grant,

The Target argument is indeed a range reference. What

exactly do
you mean when you say you can't "use it"?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grant" wrote in

message
...
Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't

use
it like Target.value or iMyInteger = RcCell Is Target

or
anything that would require an Object type.

Any ideas?

Grant.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet change sub procedure

Try

Msgbox Target(1).Value

--
Regards,
Tom Ogilvy

"Grant" wrote in message
...
Type mismatch error for msgbox Target.value

-----Original Message-----
Grant,

The Target argument is indeed a range reference. What

exactly do
you mean when you say you can't "use it"?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grant" wrote in

message
...
Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't

use
it like Target.value or iMyInteger = RcCell Is Target

or
anything that would require an Object type.

Any ideas?

Grant.



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Worksheet change sub procedure

Hi Tom,

A much more likely scenario!

Thank you.

---
Regards,
Norman



"Tom Ogilvy" wrote in message
...
Try

Msgbox Target(1).Value

--
Regards,
Tom Ogilvy

"Grant" wrote in message
...
Type mismatch error for msgbox Target.value

-----Original Message-----
Grant,

The Target argument is indeed a range reference. What

exactly do
you mean when you say you can't "use it"?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Grant" wrote in

message
...
Hi there,

The following sub procedu
Private Sub Worksheet_Change(ByVal Target As Range)

Target does not appear to be a Range object. I can't

use
it like Target.value or iMyInteger = RcCell Is Target

or
anything that would require an Object type.

Any ideas?

Grant.


.





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
Validation Procedure with a worksheet change event Bhupinder Rayat Excel Worksheet Functions 2 October 3rd 07 05:18 PM
Procedure to change Column heading from R1C1 to A1? wmidlik Excel Worksheet Functions 2 July 15th 07 05:18 PM
Worksheet/General Procedure problem [email protected] Excel Discussion (Misc queries) 2 June 29th 06 02:55 PM
WHAT IS THE PROCEDURE TO CHANGE CURENCY IN THE INVOICE WINDOW patrick Excel Discussion (Misc queries) 0 December 12th 05 11:58 AM
Using VBA to track changes in a worksheet - help! Event procedure?? a Excel Programming 7 June 24th 04 01:36 PM


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