LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro to select the result of an autofilter action

Sub selection()
Dim rng As Range

Rows("2:10").Delete Shift:=xlUp
Range("A1").AutoFilter
Set rng = Selection
rng.AutoFilter Field:=14, Criteria1:="=NAME", Operator:=xlAnd
Set rng = rng.SpecialCells(xlCellTypeVisible)
'you can now work with the rng object

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I'm doing this in a macro:


Sub selection()
'

' Macro recorded 22/12/2005 by Me
'
Rows("2:10").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
ActiveWindow.SmallScroll ToRight:=2
Selection.AutoFilter Field:=14, Criteria1:="=NAME", Operator:=xlAnd
'Select the result here

End Sub

After the AutoFilter action, I need to select only the resulting rows
and columns (with datas)
and save them in a .csv file, knowing that the result will vary from
one day to another

I have tried several things, but the problem is that all the rows and
columns (even those not displayed) are always selected and saved. I
want only to have the ones given by the autofilter.
Who can help me?

Geo



 
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
Select cells after Autofilter Haris Excel Worksheet Functions 2 October 28th 07 09:48 PM
Autofilter launching action spirosu Excel Discussion (Misc queries) 1 March 15th 06 06:23 PM
Autofilter - on select columns rudawg Excel Worksheet Functions 8 January 31st 06 06:20 AM
referencing autofilter result EH003268 Excel Discussion (Misc queries) 2 August 24th 05 02:43 PM
Using the result of autofilter and performing tasks on each value Elinor Hartman Excel Programming 1 April 23rd 04 01:34 PM


All times are GMT +1. The time now is 04:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"