PC Review


Reply
Thread Tools Rate Thread

Copy Invalid Dates records to separate worksheet

 
 
u473
Guest
Posts: n/a
 
      4th Sep 2007
How do I copy, for invalid date or date gretar than today, the Entire
row to the InvalidDates Worksheet
Looking for proper syntax. Help appreciated.

Dim rCell As Range
Dim myRow As Long
For Each rCell In Range("Z2:Z" & _
Range("Z" & Rows.Count).End(xlUp).Row)
With rCell
If IsDate(.Value) Then _
.Offset(0, -1).Value = Right(Format(.Value, "YYMM"),
3)
'If Date is greater than Today, Copy Entire row to
Invalid Dates worksheet & Delete Entire Row
'If ActiveCell.Value > Now()
' myRow =
Sheets("InvalidDates").Cells(Rows.Count, 3).End(xlUp)(2).Row
' Intersect(Target.EntireRow,
ActiveSheet.UsedRange).Copy
' Entire.row.Delete
Else
' myRow =
Sheets("InvalidDates").Cells(Rows.Count, 3).End(xlUp)(2).Row
' Intersect(Target.EntireRow,
ActiveSheet.UsedRange).Copy
'.Entire.row.Delete
End If

End With
Next rCell

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      4th Sep 2007
Sub copyinvaliddates()
For Each c In Range("a24:a26")
With Sheets("sheet7")
lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
If Not IsDate(c) Or c > Date Then _
Rows(c.Row).Copy .Cells(lr, 1)
End With
Next c
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"u473" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I copy, for invalid date or date gretar than today, the Entire
> row to the InvalidDates Worksheet
> Looking for proper syntax. Help appreciated.
>
> Dim rCell As Range
> Dim myRow As Long
> For Each rCell In Range("Z2:Z" & _
> Range("Z" & Rows.Count).End(xlUp).Row)
> With rCell
> If IsDate(.Value) Then _
> .Offset(0, -1).Value = Right(Format(.Value, "YYMM"),
> 3)
> 'If Date is greater than Today, Copy Entire row to
> Invalid Dates worksheet & Delete Entire Row
> 'If ActiveCell.Value > Now()
> ' myRow =
> Sheets("InvalidDates").Cells(Rows.Count, 3).End(xlUp)(2).Row
> ' Intersect(Target.EntireRow,
> ActiveSheet.UsedRange).Copy
> ' Entire.row.Delete
> Else
> ' myRow =
> Sheets("InvalidDates").Cells(Rows.Count, 3).End(xlUp)(2).Row
> ' Intersect(Target.EntireRow,
> ActiveSheet.UsedRange).Copy
> '.Entire.row.Delete
> End If
>
> End With
> Next rCell
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare and then copy cell to separate worksheet Matt Microsoft Excel Worksheet Functions 1 6th Feb 2009 11:22 PM
Sort by even and odd digits and copy to separate worksheet K Drier Microsoft Excel Worksheet Functions 3 3rd Sep 2008 07:56 PM
Help, Copy Records, change dates on records, save new updated reco =?Utf-8?B?Y2NfY3Jhc2g=?= Microsoft VB .NET 0 24th May 2007 01:29 PM
How do I copy each row from 1 Worksheet to separate Worksheets? =?Utf-8?B?RGFuZGVsbw==?= Microsoft Excel Misc 3 8th Jul 2006 03:00 PM
Copy data automatically onto a separate worksheet =?Utf-8?B?UmVl?= Microsoft Excel Misc 1 11th May 2006 07:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:23 AM.