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: 4
Default Validation issue

Hi all,

What I'm trying to do is validate a single cell to ensure that the date is
greater than todays date. The cell in question has a calendar that pops up
when you select it and this is how the date for that cell is selected.
unfortuantely this means that the normal method of performing this
validation doesn't work. My calendar code is in 'Sheet1' is this the best
place for this new code?

Currently I get a: Run-time error '1004'
'Method Range' of object'_Worksheet' failed

Here is what I have so far.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Opens the calendar form
addr = ActiveCell.Address
If addr = "$G$38" Or addr = "$K$38" Then
Call OpenCalendar
End If
'Checks that the date selected is valid
If Range(G38) < Date Then
MsgBox "The date that you entered is in the past!"
Cancel = True
End If
End Sub


I have no idea if I'm even on the right track.

Thanks,
Insp Gadget


 
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
Data Validation issue help request Misop1 Excel Worksheet Functions 0 August 8th 07 08:32 PM
Data Validation issue help request Misop1 Excel Worksheet Functions 0 August 8th 07 08:32 PM
Data Validation Issue? Karba Excel Discussion (Misc queries) 1 June 21st 07 05:00 PM
Data validation issue mevetts Excel Worksheet Functions 4 November 28th 05 02:02 PM


All times are GMT +1. The time now is 06:29 AM.

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"