Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Heydilbert
 
Posts: n/a
Default [B]Conditional Macro?[/B]


Hey.

Is it possible to activate a Macro when a cell contains a certain
value?

or anything similar


--
Heydilbert
------------------------------------------------------------------------
Heydilbert's Profile: http://www.excelforum.com/member.php...o&userid=28748
View this thread: http://www.excelforum.com/showthread...hreadid=484412

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default [B]Conditional Macro?[/B]

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = 99 Then
'do your stuff
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Heydilbert" wrote
in message ...

Hey.

Is it possible to activate a Macro when a cell contains a certain
value?

or anything similar


--
Heydilbert
------------------------------------------------------------------------
Heydilbert's Profile:

http://www.excelforum.com/member.php...o&userid=28748
View this thread: http://www.excelforum.com/showthread...hreadid=484412



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
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
save original data after macro is run again MINAL ZUNKE New Users to Excel 3 July 7th 05 12:48 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 12:01 PM.

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"