importing only a few records from one sheet to another...

snapper97

New Member
Joined
Jan 16, 2005
Messages
3
I apologize in advance if this was answered in another post.

I have a worksheet that contains about three hundred records and has about four records added each week. Only two or three a month meet a certain criteria. I would like to have those records automatically added to its own seperate sheet.

For example:
(ignore the dots, just for spacing)
Where anything in column "A" is lower than 5, copy the entire record to another worksheet or workbook.

.......A....B....C....D....E....F....
1....15...2....6....19...12...5...
2....3.....1....21...4....10...8...
3....14...4....7.....11...9....11
4....12...6....8.....10...8....23
5....2.....7....20...3.....10..5
6....15...1....6.....17...9....8

My boss wants to just click on the "less than 5" tab and have them automatically there. Thanks so much for you help.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Re: importing only a few records from one sheet to another..

You could use Data, Filter, Autofilter, Custom, and select your criteria. If you want this data on another sheet, you could copy it, and PasteSpecial, Values. If you need this to be a macro or automated procedure, post back and I'm sure someone can come up with code to do this. Hope that helps!

EDIT:
Unfortunately, Autofilter wouldn't work too well if you don't have column headings. If that's not an option, please indicate that.
 
Upvote 0
Re: importing only a few records from one sheet to another..

Yes, automated. I already drop by her office FAR too often, and I would like to make it as unintensive as possible.

Thanks for the help, though.
 
Upvote 0
So set up an Advanced filter on sheet2, using a dynamic range referring to the data on sheet1. Then just have a button to press to refresh the filter, or even tie it to the worksheetchange event or something like that. That way it won't be formula intensive either.
 
Upvote 0
Define the Name 'Database' as

=OFFSET(Sheet1!$A$1,,,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:$1))

Then on sheet2 set up the ranges as needed and define the Criteria range as 'Criteria' and the Extract range as 'Extract'

Now just put a button on the sheet and refer to the following code:-


Code:
Sub FilterData()
    Range("Database").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range _
        ("Criteria"), CopyToRange:=Range("Extract"), Unique:=False
End Sub
 
Upvote 0
Re: importing only a few records from one sheet to another..

Thank you, Ken for your help. I hope this does this trick. I'll try to apply this as best I can. Honestly, I've never tried anything this dynamic with excel.

Wish me luck.
 
Upvote 0

Forum statistics

Threads
1,202,913
Messages
6,052,527
Members
444,588
Latest member
ViJN

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top