#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Copy and paste

Hi all,
I have some columns(A,B) in my Excel sheet that don't allow to the users to
insert a date prior to today's date,as i used data validation to achieve
this,but actually users write a date in other columns and paste them in the
columns(A,B) in order to put a date that's prior to today's date,how can i
solve this problem?
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Copy and paste

How about a sheet event code?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 2 Then Exit Sub

Application.EnableEvents = False
If Target.Value2 < Int(Now) Then
Target.Value = ""
MsgBox "Please do not pre-date"
End If
Application.EnableEvents = True

End Sub

place it in the sheet module for the sheet you are using.
--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Pietro" wrote in message
...
Hi all,
I have some columns(A,B) in my Excel sheet that don't allow to the users
to
insert a date prior to today's date,as i used data validation to achieve
this,but actually users write a date in other columns and paste them in
the
columns(A,B) in order to put a date that's prior to today's date,how can i
solve this problem?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Copy and paste

Say A1 is a cell into which the user should enter a date, but not a date
prior to today's date.

In A1 enter:
=IF(TODAY()<Z1,Z1,TODAY())
Then protect A1 and tell the user to enter dates in Z1. Because A1 is
protected, the user can't change it in any way. If the user screws up the
data in Z1, you get today as a default.

You don't have to be much smarter than a user, even a little bit smarter
will do.
--
Gary''s Student
gsnu200708


"Pietro" wrote:

Hi all,
I have some columns(A,B) in my Excel sheet that don't allow to the users to
insert a date prior to today's date,as i used data validation to achieve
this,but actually users write a date in other columns and paste them in the
columns(A,B) in order to put a date that's prior to today's date,how can i
solve this problem?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Copy and paste

He can't ... it's the boss' son!<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Don Guillett" wrote in message
...
Fire them

--
Don Guillett
SalesAid Software

"Pietro" wrote in message
...
Hi all,
I have some columns(A,B) in my Excel sheet that don't allow to the users
to
insert a date prior to today's date,as i used data validation to achieve
this,but actually users write a date in other columns and paste them in
the
columns(A,B) in order to put a date that's prior to today's date,how can

i
solve this problem?




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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM
Copy/paste/paste special is not available Diane109 Excel Discussion (Misc queries) 3 December 2nd 04 01:46 AM


All times are GMT +1. The time now is 01:01 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"