Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default custom auto filter

Hi

When i do Custome autofillter for 'Mon' in Month Column, and if 'Mon' is not
found then exit sub if found then copy the entire sheet.


example:
Month
Mon
Tue
Wed
Mon



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default custom auto filter

Dim rng As Range
Dim LastRow As Long

Columns(1).AutoFilter
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Range("A1").Resize(LastRow)
rng.AutoFilter field:=1, Criteria1:="Mon"
On Error Resume Next
Set rng = rng.SpecialCells(xlCellTypeVisible)
On Error GoTo 0

If rng.Rows.Count 1 Then

Cells.Copy
'do something with it
End If

rng.AutoFilter


--
__________________________________
HTH

Bob

"Ranjit kurian" wrote in message
...
Hi

When i do Custome autofillter for 'Mon' in Month Column, and if 'Mon' is
not
found then exit sub if found then copy the entire sheet.


example:
Month
Mon
Tue
Wed
Mon





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
Auto filter custom filter stevefromnaki Excel Worksheet Functions 2 December 30th 09 06:23 AM
Custom Auto Filter Dave Excel Discussion (Misc queries) 1 October 1st 09 02:19 PM
Custom auto filter (Dates) Rum Excel Worksheet Functions 2 July 6th 09 08:56 PM
Does anyone know how to tweak Custom Auto Filter box? [email protected] New Users to Excel 4 July 5th 07 03:48 PM
Custom Auto Filter Vadhimoo Excel Programming 2 November 24th 06 10:45 AM


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