Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Can you use "Target" in a Module besides the worksheet module

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Can you use "Target" in a Module besides the worksheet module

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.


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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Can you use "Target" in a Module besides the worksheet module

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
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
Get a VB "Compile error in hidden module: DistMon" at start Dave Excel Discussion (Misc queries) 1 August 10th 09 12:19 AM
How correct (or remove) "Compile error in hidden module: DistMon" wlfoote Excel Discussion (Misc queries) 1 June 6th 09 02:57 AM
"compile error in hidden module": DISTMOD -- ideas to fix it?? Clare Excel Discussion (Misc queries) 3 May 29th 08 01:44 AM
make a "selection" in a word document from a module in excel eholz1 Excel Programming 2 September 20th 06 04:57 PM
Trying to create a custom "clear worksheet" function (in a VBA module) Scott Lyon Excel Programming 1 July 29th 03 08:34 PM


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

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"