LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using autofilter results

Hi,

I have a sheet with a reader at the top e with lots of lines of data bellow
it.

I need to fill a column with a flag(1,2 ,3 or 4) , depending on the data
contained in each row.
I'm using autofilter to select some of the rows e filll that column(called
TYPE).

Above some piece of code I'm using:

Set rnData = .UsedRange
With rnData
Selection.AutoFilter Field:=33, Criteria1:="0", Operator:=xlAnd
a = Selection.SpecialCells(xlCellTypeVisible).Areas(2) .Rows.Count
If Not (Selection.SpecialCells(xlCellTypeVisible).Rows.Co unt = 1 _
And Selection.SpecialCells(xlCellTypeVisible).Areas.Co unt = 2)
Then
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count) _
.SpecialCells(xlCellTypeVisible).Select
...

A problem that raised during my tests was to check if the filtering i
just done
returned no results, because in that situation i didnt need to fill de TYPE
column.
After some tests i figured out that no results was equal to
Rouws.COunt = 1 and Areas.Count = 2, as u may see in the above code.
I'm not sure if this trick will work always, so I ask you:
Is there any better way to check a no results filtering??

Cleber
 
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
Average over autofilter results QB Excel Worksheet Functions 4 September 30th 09 04:17 PM
Autofilter results Ben Wunderin Excel Discussion (Misc queries) 3 December 2nd 08 12:31 AM
Get Average on results of Autofilter [email protected] Excel Programming 3 May 8th 06 11:42 PM
Strange Results with Autofilter Joyce Excel Discussion (Misc queries) 1 January 17th 05 02:42 AM
Delete results of Autofilter??? Kobayashi[_31_] Excel Programming 4 February 18th 04 05:37 PM


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