Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie stuck
Hi folks,
I wonder if anyone can help. I have created a macro to create a message box if the value of a cell is greater than 15 hours. I have:- sub flexi_hours_gained() 'Macro to give a message if the flexi time = 15:00 If Range ("Flexi_hours_gained")=0.625 then MsgBox "15 hours is the maximum allowable flexi time gained" End If End Sub So far so good, I run the macro and it works, but I need the message box to appear automatically if the range value is 15 hours (0.625). The range value is not entered but calculated and the cell is protected, part of a protected sheet. Anyone have any ideas? For the recortd I have been learning VBA for about 4 hours :-) Thanks in advance, Danny |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Newbie stuck
put this code in the appropriate sheet module ie (sheet1, sheet2 etc...)
sub worksheet_change(byval target as excel.range) 'Macro to give a message if the flexi time = 15:00 If Range ("Flexi_hours_gained")=0.625 then MsgBox "15 hours is the maximum allowable flexi time gained" End If End Sub -- When you lose your mind, you free your life. "Danny Jurmann" wrote: Hi folks, I wonder if anyone can help. I have created a macro to create a message box if the value of a cell is greater than 15 hours. I have:- sub flexi_hours_gained() 'Macro to give a message if the flexi time = 15:00 If Range ("Flexi_hours_gained")=0.625 then MsgBox "15 hours is the maximum allowable flexi time gained" End If End Sub So far so good, I run the macro and it works, but I need the message box to appear automatically if the range value is 15 hours (0.625). The range value is not entered but calculated and the cell is protected, part of a protected sheet. Anyone have any ideas? For the recortd I have been learning VBA for about 4 hours :-) Thanks in advance, Danny |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Real Newbie newbie question | New Users to Excel | |||
Newbie stuck on Passing a Variable into a Range | Excel Programming | |||
Newbie stuck on Passing a Variable into a Range | Excel Programming | |||
Newbie stuck on Passing a Variable into a Range | Excel Programming | |||
Newbie stuck on Passing a Variable into a Range | Excel Programming |