Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alan,
I must have misread your post as l did not relaise you wanted the macro to fire automatically. Using your example the following code will fire if the user enters anything into the target cells expect the word 'nothing'. The code must be placed, as in your example, in the sheet 2 code module and the Worksheet_Change event. Please note that if the values in the target cells are changed by way by of a formula the event will not trigger. The target addresses must be cells that are changed manually. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$4" Or _ Target.Address = "$F$4" Or _ Target.Address = "$I$4" Or _ Target.Address = "$B$6" Or _ Target.Address = "$F$6" Or _ Target.Address = "$I$6" Then If Target.Value < "Nothing" Then MsgBox ("You have entered something") CHANGE THIS TO CALL YOUR MACRO End If End If End Sub Regards Michael Beckinsale |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do i enable "Group" & "Ungroup" in a protected sheet | Excel Discussion (Misc queries) | |||
how do i enable a drop down list depending on result of "if" funct | Excel Worksheet Functions | |||
How to disable annoying "Enable Macro" popup | Excel Programming | |||
How to realize "enable macro" by VBA when opening a file with macr | Excel Programming | |||
excel.application.run macro1 -- added code to respond "yes" to a inputbox | Excel Programming |