Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Check Input, into Input box question

Hello all, i have an input box(code below) and i have 3 entries, is
there a way that i can check that each entry made in the input box is in
actual fact in the date format 26/07/07 ??

Private Sub Workbook_Open()
'
Dim strDates As String, s As Variant

strDates = Application.InputBox("Enter the ""from"" ""to"" dates and
the" & vbCrLf & _
"date paid, each date seperated by a
"",""..", "SALARY PERIOD")
If strDates = False Then
End
Else
s = Split(strDates, ",")
Range("B11").Value = s(0)
Range("D11").Value = s(1)
Range("B21").Value = s(2)
PrintSlip
End If

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Check Input, into Input box question

A partial solution is to declare a date variable and test the input
values with it, e.g.
Dim dt1 as Date
dt1 = s(0)

If the input value isn't a date, a type mismatch will result.

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Check Input, into Input box question

Thanks merjet, will try... :0)

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
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
Input box data check Mark[_8_] Excel Discussion (Misc queries) 5 January 2nd 09 09:47 PM
Check for repeated input Jamuck Excel Programming 2 January 26th 06 01:12 PM
check input in cells Pierre via OfficeKB.com[_2_] Excel Programming 1 November 19th 05 11:05 AM
input check in cell question Pierre via OfficeKB.com[_2_] Excel Programming 0 November 7th 05 07:19 AM
Check on the input in an inputbox Tempy Excel Programming 5 May 17th 05 02:01 PM


All times are GMT +1. The time now is 11:20 PM.

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"