Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Get a VB "Compile error in hidden module: DistMon" at start | Excel Discussion (Misc queries) | |||
How correct (or remove) "Compile error in hidden module: DistMon" | Excel Discussion (Misc queries) | |||
"compile error in hidden module": DISTMOD -- ideas to fix it?? | Excel Discussion (Misc queries) | |||
make a "selection" in a word document from a module in excel | Excel Programming | |||
Trying to create a custom "clear worksheet" function (in a VBA module) | Excel Programming |