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: 184
Default Copy Invalid Dates records to separate worksheet

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

 
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
Compare and then copy cell to separate worksheet Matt Excel Worksheet Functions 1 February 6th 09 11:22 PM
Sort by even and odd digits and copy to separate worksheet K Drier[_2_] Excel Worksheet Functions 3 September 3rd 08 07:56 PM
Copy specific records from a worksheet to another Irfan Excel Worksheet Functions 3 January 29th 08 05:36 PM
copy specific records to new worksheet violet Excel Programming 1 September 22nd 06 01:31 PM
How do I copy each row from 1 Worksheet to separate Worksheets? Dandelo Excel Discussion (Misc queries) 3 July 8th 06 03:00 PM


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