Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

auto run macro/sub when cell gets focus

333 views
Skip to first unread message

Hilton

unread,
Apr 13, 2001, 10:42:02 AM4/13/01
to
How do I auto run a macro and or sub when a PARTICULAR
cell in Excel gets the focus IE one cell only.
Then for that macro/sub to run once only.
Any help appreciated.
Hilton

Tom Ogilvy

unread,
Apr 13, 2001, 11:43:13 AM4/13/01
to
What to you mean by Once Only.

Once only for the life of the entire spreadsheet. Once each time the
spreadsheet is opened. Once each time the value in the cell changes. Once
each time the sheet is activated.

Does the cell contain a formula? If so, does it have to stay a formula
after the macro has "run Once"?

Regards,
Tom Ogilvy

"Hilton" <hgg...@iinet.net.au> wrote in message
news:3AD7103A...@iinet.net.au...

Otto Moehrbach

unread,
Apr 14, 2001, 4:59:51 PM4/14/01
to
What does " focus" mean in your context? Otto

"Hilton" <hgg...@iinet.net.au> wrote in message
news:3AD7103A...@iinet.net.au...

M Satyanarayana

unread,
Apr 14, 2001, 9:25:54 PM4/14/01
to
I suppose u want
(a) the macro/sub to run when the cell gets focus for the first time after
worksheet is opened
(b) the macro should not run when the cell gets focus any time after that
It is possible to do (a). If the cell u have in mind is $A$1

Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Range = "$A$1" Then
...Code to run...
End If
End Sub

This sub runs every time the cell gets focus
MS
"Otto Moehrbach" <ot...@worldnet.att.net> wrote in message
news:bT2C6.1083$hH3.1...@bgtnsc04-news.ops.worldnet.att.net...

0 new messages