PC Review


Reply
Thread Tools Rate Thread

Can you use "Target" in a Module besides the worksheet module

 
 
kylekelsch@hotmail.com
Guest
Posts: n/a
 
      30th Jan 2007
I'm making an order entry program and Im wondering if there is a way
to refer to the target in any module, not just the worksheet module

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      30th Jan 2007
I think what you want is to pass the target to that other routine?

You'll still need that worksheet (workbook?) event to call that routine, though.

For instance, I used this code behind the worksheet:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Call myOtherSub(Target.Cells(1))
End Sub

And this code in a General module:
Option Explicit
Sub myOtherSub(myCell As Range)
MsgBox myCell.Address(0, 0)
End Sub

Whenever I change anything in the worksheet, I pass the first cell in the
changed range to the myOtherSub routine.


(E-Mail Removed) wrote:
>
> I'm making an order entry program and Im wondering if there is a way
> to refer to the target in any module, not just the worksheet module


--

Dave Peterson
 
Reply With Quote
 
kylekelsch@hotmail.com
Guest
Posts: n/a
 
      30th Jan 2007
thanks Dave I've looked all over trying to find a good why to do that
and could't find anything. Your suggestion worked perfect.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error in hidden module: "Module Name" Eric Microsoft Excel Programming 4 5th Mar 2008 05:20 AM
Can't "Call" Error Handler in Standard Module from Form Module =?Utf-8?B?Sm9obiBE?= Microsoft Access VBA Modules 8 21st Apr 2007 07:24 PM
how to get rid of "compile error in hidden module: <module name>" =?Utf-8?B?ZWxpZSBoYXJiICA8ZWRoLmFudEBob3RtYWlsLmNv Microsoft Word Document Management 1 18th Feb 2006 01:02 PM
Module->GetModule(S"module.dll") return NULL Lewap Microsoft C# .NET 0 19th Jan 2005 07:37 AM
Trying to create a custom "clear worksheet" function (in a VBA module) Scott Lyon Microsoft Excel Programming 1 29th Jul 2003 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 AM.