LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Check Input for Valid Month

Hello,
I am looking for a code that will automatically check an input box to make
sure the values entered are accurate. I don't know how to check to make sure
the month entered is the full name (and spelled correctly), and if not an
error message comes up to prompt for a correct entry. Thanks in advance!


Sub testdate()
Dim MyDate
Dim Message As String, Title As String
Dim current_date As String

MyDate = Format(Date, "mmmm yyy")

Message = "ENTER FULL MONTH AND YEAR FOR REPORT:"
Title = "Enter Date"
Default = MyDate
current_date = InputBox(Message, Title, Default)

Application.ScreenUpdating = False

With Sheets("Summary").Range("B2")
.NumberFormat = "mmmm yyy"
.Value = current_date
End With
Application.ScreenUpdating = True

End Sub
 
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
How to check valid Date value? hstijnen Excel Worksheet Functions 1 August 14th 06 01:25 PM
Checking user has input a valid address. Peter Rooney Excel Programming 1 March 7th 06 10:57 PM
Check if date is valid Lava[_12_] Excel Programming 4 October 19th 05 03:28 PM
Waiting for a valid input serge Excel Programming 1 January 16th 04 02:47 PM
check for valid file pabs[_21_] Excel Programming 2 January 15th 04 06:52 AM


All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"