From: Kash on
Hello there.. I was trying to cut the entire row and paste it to another
sheet if date is more than 20 days

say date column is 'H'

Someone please help me on this..

Thank you..
From: Mike H on
If date is more than 20 days what. In the past? In the future? something else?
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Kash" wrote:

> Hello there.. I was trying to cut the entire row and paste it to another
> sheet if date is more than 20 days
>
> say date column is 'H'
>
> Someone please help me on this..
>
> Thank you..
From: Kash on
I'm sorry.. if date is 20 days behind..
From: Mike H on
Hi,

try this

Sub stance()
Dim MyRange
Dim CopyRange As Range
Set sht = Sheets("Sheet1")
lastrow = sht.Cells(Cells.Rows.Count, "H").End(xlUp).Row
Set MyRange = sht.Range("H1:H" & lastrow)
For Each c In MyRange
If c.Value < Date - 20 Then
If CopyRange Is Nothing Then
Set CopyRange = c.EntireRow
Else
Set CopyRange = Union(CopyRange, c.EntireRow)
End If
End If
Next
If Not CopyRange Is Nothing Then
CopyRange.Copy Destination:=Sheets("Sheet2").Range("A1")
End If
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Kash" wrote:

> I'm sorry.. if date is 20 days behind..
From: Kash on
This works great.. Thank you Mike
 |  Next  |  Last
Pages: 1 2
Prev: cancel a combobox change
Next: Check user credentials