![]() |
Formula to get data when condition is satisfied
Hi,
Can I have formula to copy the rows that contains todays date from book1.xls to book2.xls? Thanks |
Formula to get data when condition is satisfied
Hi,
A bit more detail would have helped but try this. Right click the sheet tab where the data are, view code and paste this in and run it. Sub copyit() Dim MyRange, MyRange1 As Range lastrow = Cells(Rows.Count, "A").End(xlUp).Row Set MyRange = Range("A1:A" & lastrow) For Each c In MyRange If c.Value = Date Then If MyRange1 Is Nothing Then Set MyRange1 = c.EntireRow Else Set MyRange1 = Union(MyRange1, c.EntireRow) End If End If Next If Not MyRange1 Is Nothing Then MyRange1.Copy Workbooks("Book2.xls").Sheets(1).Range("A1").Paste Special End If End Sub Mike "Kashyap" wrote: Hi, Can I have formula to copy the rows that contains todays date from book1.xls to book2.xls? Thanks |
All times are GMT +1. The time now is 11:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com