Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2004, 08:26 AM
Authorized User
 
Join Date: Jan 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default select rows based on a criteria and paste

Hi

I want to select rows from a range (variable) of rows. The criteria is tht the value in the 'Complaints' col shud be "OEPN". Then i want to paste these rows in sheet 3 of the same workbook.

Please help!
ashu

 
Old July 26th, 2004, 11:25 AM
Authorized User
 
Join Date: Jun 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you should try something like this.

Private Sub FilterData()

Worksheets("Data").Range("A1").AutoFilter Field:=6, Criteria1:="Open"
Worksheets("Data").Range("A1").CurrentRegion.Copy Destination:=Worksheets("Filtered").Range("A1")
Worksheets("Filtered").Columns.AutoFit

End Sub

 
Old July 30th, 2004, 01:32 AM
Authorized User
 
Join Date: Jan 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks! It worked. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple criteria on a select query? jihadbuster XSLT 4 March 19th, 2008 01:52 PM
sum group values based on cell criteria darkdestroyer Excel VBA 1 January 9th, 2008 09:13 PM
attach excel content to emails,based on criteria miracles Excel VBA 0 May 21st, 2007 09:45 PM
'Search Form' based on criteria Grafixx01 Access 7 May 4th, 2007 09:39 AM
Report Heading Based On Selection Criteria Fo CloudNine Access 5 March 4th, 2004 08:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.