View Single Post
 
Old 08-21-2008, 12:35 PM
Onihonker Onihonker is offline
Novice
 
Join Date: Aug 2008
Posts: 8
Onihonker is on a distinguished road
Default

I did some more work and found a solution that works.

It runs a check on Cell E5, changes its value to 50 if it is greater then 50 and then shows a message box to the user stating a change was made.

Sub GreaterThenFifty() 'Name of macro
Dim WeekNumber As Double 'Use Double instead in case a half a week is used. Double allows decimal points and larger values to be entered then Integer
Dim WeekChange As Double 'Use Double instead in case a half a week is used. Double allows decimal points and larger values to be entered then Integer

WeekNumber = ActiveSheet.Range("E5").Value

If WeekNumber > 50 Then 'Check if WeekNumber is greater the 50
ActiveSheet.Range("E5").Value = 50 'Change Cell E5 to 50 if above statement is true
Msg = "Week Number is greater then 50. Changed to 50."
MsgBox Msg 'Inform the user of the change
End If

End Sub

If this solution helped you please click the scales and raise my reputation.

Last edited by Onihonker; 08-21-2008 at 01:16 PM.
Reply With Quote