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: 60
Default Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet

Hi guys,

I'm working now on a piece of code that is basically choosing criteria in
column A and copying displayed info next to it (column A excluded) to
another place.

(...)
Selection.AutoFilter Field:=1, Criteria1:="myCriteria"
Range("B...").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
(...)

I have 3 questions related to this:

a) how to tell the code that if there are no rows fulfilling the criteria,
it should skip this part and go further?
b) how to specify the row number in "Range("B...").Select" (it's obviously
varying depending on criteria)?
- I could perhaps start in A2 instead of B<volatile_row - that could
be one of the solutions, both for point b) and c)
c) how to avoid the situation where there is only one line related to
criteria and using "Selection.End(xlDown)" will go until 65536?

I'll continue to look for a solution by myself, but if you know the answer,
thanks to let me know...

Thanks and cheers,
Mark


 
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
=DMIN(database,field,criteria) question about criteria Dummy Excel Discussion (Misc queries) 2 April 16th 07 08:02 PM
Autofilter criteria not yet known JeffMelton Excel Programming 1 July 25th 06 08:12 AM
AutoFilter criteria Mark Excel Programming 1 November 2nd 05 12:08 PM
Selection.AutoFilter Field:=1 MBlake[_2_] Excel Programming 7 August 25th 05 08:03 PM
AutoFilter Criteria VBA EstherJ Excel Programming 2 August 20th 04 12:54 PM


All times are GMT +1. The time now is 07:38 AM.

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"