Is there a excel function that I can use to solve my problem? Help! In sheet 1 I have the follow data:

Line No Amount MaturityDate

790 500 12/31/10

790 350 10/8/15

790 65 9/6/09

1230 135 6/30/11

3265 653 7/4/12I want to pick all the data with line No. 790 from sheet 1 to sheet2. I know that I can use filter function and copy paste to sheet 2. But is there a function I can use in this scenario? Thanks!!

Is the data sorted just like your example or would the 790 be mixed in all over the place? Is 790 the only number you are looking for or will you be puliing in data from the other numbers at various times?

Would you be willing to use a macro instead of an Excel function?

The No.790 is in the Line No. column, and that is the only number that I'm looking for. If you can show me how to use macro in this scenario, that would be great. Thanks for your help!

I guess that means that the answer to my first question is "No". Maybe this will get you started:

Sub Copy790() For sht1Row = 1 To 1000 If Sheets(1).Range("A" & sht1Row) = 790 Then sht2Row = sht2Row + 1 Sheets(1).Range("A" & sht1Row).EntireRow.Copy _ Destination:=Sheets(2).Range("A" & sht2Row) End If Next End Sub

It works! Thanks a lot DerbyDad03!

Ask Your Question

Weekly Poll

Would you ride in a self-driving car from Tesla?

Discuss in The Lounge

Poll History