G'day Everyone,
This may be simple, but it has this basic user flummoxed: how do I set
up a cell so that, once data is entered and the cell is exited, a macro
is performed using the data?
cheers,
nonshedders--
nonshedders
------------------------------------------------------------------------
nonshedders's Profile: www.excelforum.com/member.php...oamp;userid=33397
View this thread: www.excelforum.com/showthread...hreadid=532203Do you mean how is a macro executed when data is entered into a specific
cell? How do you want the exiting of the cell to play into this? To
execute a macro when data is entered into a specific cell, you would use a
Worksheet_Change macro like the following. I chose F3 as the specific cell
and a macro named TheMacro as the macro you want executed..
Note that, as written, TheMacro will fire if data is entered only in F3. If
you want TheMacro executed when data is entered into any cell in a range of
cells, then the macro below will have to be changed to reflect that and you
might need to pass the cell address and /or cell value to TheMacro when you
call it. Post back if you need more. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count gt; 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Address(0, 0) = quot;F3quot; Then Call TheMacro
End Sub
quot;nonsheddersquot; gt;
wrote in message
...
gt;
gt; G'day Everyone,
gt;
gt; This may be simple, but it has this basic user flummoxed: how do I set
gt; up a cell so that, once data is entered and the cell is exited, a macro
gt; is performed using the data?
gt;
gt; cheers,
gt;
gt; nonshedders
gt;
gt;
gt; --
gt; nonshedders
gt; ------------------------------------------------------------------------
gt; nonshedders's Profile:
gt; www.excelforum.com/member.php...oamp;userid=33397
gt; View this thread: www.excelforum.com/showthread...hreadid=532203
gt;
- Jul 16 Mon 2007 20:38
Macro on exit cell
close
全站熱搜
留言列表
發表留言