Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default 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
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
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie stuck on Passing a Variable into a Range Dana DeLouis[_5_] Excel Programming 1 August 13th 03 11:43 PM
Newbie stuck on Passing a Variable into a Range Dave Baranas Excel Programming 0 August 13th 03 07:54 AM
Newbie stuck on Passing a Variable into a Range Bob Kilmer Excel Programming 0 August 13th 03 02:38 AM
Newbie stuck on Passing a Variable into a Range Bob Kilmer Excel Programming 0 August 13th 03 02:20 AM


All times are GMT +1. The time now is 01:49 AM.

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"