Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Basic 2007 Activation Problem Dazza7 Office 0 07-30-2008 07:59 AM
Need some basic help on Project NewToProject Project 0 04-06-2008 07:03 AM
Powerpoint and Visual Studio ferrja PowerPoint 0 03-29-2006 08:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft