Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
~Is it possible to set up a macro to run if something is put in a
certain cell? (eg. B3 to run macro "All"). Thanks Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually if a value changes in a certain cell
-- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
You can use the Change event of the worksheet. In the code module for the appropriate worksheet, use the following: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$3" Then If StrComp(Target.Text, "All", vbTextCompare) = 0 Then ' your code here End If End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Stu" wrote in message ... ~Is it possible to set up a macro to run if something is put in a certain cell? (eg. B3 to run macro "All"). Thanks Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
You can trap a change to a cell using worksheet event code Private Sub Worksheet_Change(ByVal Target As Range) Application .EnableEvents = False On Error GoTo ws_exit If (Not Intersect(Target, Range("B3")) Is Nothing) Then 'add a call to your macro here End If ws_exit: Application.EnableEvents = True End Sub To add this, right-click on the sheet name tab, select View Coide from the menu, and paste the code in . -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Stu" wrote in message ... ~Is it possible to set up a macro to run if something is put in a certain cell? (eg. B3 to run macro "All"). Thanks Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |