Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default how to autofilter for the remaining values????

hi.

I am doing an autofiler on the main sheet and copying the
data into new sheets. My criteria's a
1. 03881DCACAUA
2. 40006DCUV
3. 03881DCEAUA
4. A2630DCACAUA
5. A2630DCEAUA

This i work with the below pasted code; which is working
fine. Now my last sheet to be created should contain all
the left over values in the column. LIke apart from the 5
values in the column mentioned above their are some 12-15
more different values. How to copy the remaining ones and
paste in the sheet.


thanks a lot

Sub CopyFilter1()

Dim rng As Range
Dim rng2 As Range

Sheets.Add
ActiveSheet.Name = "AG DCE"
Worksheets(SalesSheetName).Activate
Selection.Autofilter Field:=5, Criteria1:="A2630DCEAUA"
With ActiveSheet.Autofilter.Range
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1,
1).SpecialCells(xlCellTypeVisible)
On Error GoTo 0
Debug.Print rng2.Address
End With
If rng2 Is Nothing Then
MsgBox "No data to copy"
Else
Worksheets("AG DCE").Cells.Clear
Set rng = ActiveSheet.Autofilter.Range
rng.Offset(0, 0).Resize(rng.Rows.Count - 1).Copy
Destination:=Worksheets("AG DCE").Range("A1")
End If
ActiveSheet.ShowAllData

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default how to autofilter for the remaining values????

You could extract the remaining records with an Advanced Filter. There
are instructions he

http://www.contextures.com/xladvfilter01.html#ExtractWs

Set up a criteria area with five columns, each with the heading from
field 5, and in the row below, each of the criteria you listed, e.g.

Code Code Code Code Code
<03881DCACAUA <40006DCUV <03881DCEAUA <A2630DCACAUA <A2630DCEAUA

Then, record a macro as you filter the data to the new worksheet.

monica wrote:
hi.

I am doing an autofiler on the main sheet and copying the
data into new sheets. My criteria's a
1. 03881DCACAUA
2. 40006DCUV
3. 03881DCEAUA
4. A2630DCACAUA
5. A2630DCEAUA

This i work with the below pasted code; which is working
fine. Now my last sheet to be created should contain all
the left over values in the column. LIke apart from the 5
values in the column mentioned above their are some 12-15
more different values. How to copy the remaining ones and
paste in the sheet.


thanks a lot

Sub CopyFilter1()

Dim rng As Range
Dim rng2 As Range

Sheets.Add
ActiveSheet.Name = "AG DCE"
Worksheets(SalesSheetName).Activate
Selection.Autofilter Field:=5, Criteria1:="A2630DCEAUA"
With ActiveSheet.Autofilter.Range
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1,
1).SpecialCells(xlCellTypeVisible)
On Error GoTo 0
Debug.Print rng2.Address
End With
If rng2 Is Nothing Then
MsgBox "No data to copy"
Else
Worksheets("AG DCE").Cells.Clear
Set rng = ActiveSheet.Autofilter.Range
rng.Offset(0, 0).Resize(rng.Rows.Count - 1).Copy
Destination:=Worksheets("AG DCE").Range("A1")
End If
ActiveSheet.ShowAllData

End Sub



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Pivot Table - Old remaining values for rows ZorionK Excel Worksheet Functions 3 April 16th 09 06:36 AM
values not appearing in autofilter list maryj Excel Discussion (Misc queries) 5 September 13th 06 10:38 PM
Extract AutoFilter Column Values? dwayneh Excel Discussion (Misc queries) 2 June 3rd 05 04:18 AM
AutoFilter list of values R.J.H. Excel Discussion (Misc queries) 2 April 19th 05 04:49 PM
AutoFilter Values + DropDown Boxes VBA chrisdarl[_5_] Excel Programming 0 April 26th 04 10:20 PM


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