Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 131
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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

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
countif and sum if if two condition are satisfied zafar62 Excel Worksheet Functions 3 July 15th 08 06:22 AM
Condition font color in a single cell based on its formula data. Bee Excel Worksheet Functions 3 February 19th 08 12:09 AM
Looping till condition is satisfied? Jo[_2_] Excel Worksheet Functions 3 October 4th 07 09:43 PM
How to change the value of a cell when a condition is satisfied, but not otherwise? benzi_k_ahamed Excel Discussion (Misc queries) 0 January 11th 06 11:31 AM
Deletion of rows where a value is satisfied Larry Wallis Excel Worksheet Functions 1 February 22nd 05 12:41 PM


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