Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Autofilter using a second column

Hi everyone

The code below works Ok until I try to add a line of code to filter on "YES"
in column H.


Sub Transfer_Value() ' IN USE 22-01-2006

Dim dDate As Date
Dim fDate As Date
Dim wsdYsr As Worksheet ' Desination worksheet
Dim wbscWgs As Worksheet ' Source worksheet

Set wsdYsr = Workbooks("Book1.xls").Worksheets("Sheet1")
Set wbscWgs = Workbooks("Book2.xls").Worksheets("Sheet2")

ActiveSheet.AutoFilterMode = False ' Take the
Autofilter off
Application.ScreenUpdating = False

dDate = CDate(InputBox("Enter First Day Year"))
[K2].Value = dDate
fDate = CDate(InputBox("Enter First Day of following Year"))
[K1].Value = fDate
MyFirstDate = Range("K2") * 1 ' force to a
LONG
MySecondDate = Range("K1") * 1 ' force to a LONG
Rows("8:8").AutoFilter

Rows("8:8").AutoFilter Field:=1, Criteria1:="=" & MyFirstDate,
Operator:=xlAnd _
, Criteria2:="<" & MySecondDate
''' ==========
PROBLEM!!
How do I include/add this recorded line of code to filter on the 8th column?
recorded code:- Selection.AutoFilter Field:=8, Criteria1:="YES"
''' =========

wsdYsr.[g28].Value = wbscWgs.[E6].Value

End sub

TIA
--
Thank you

Regards
Aussie Bob C.
Using Windows XP Home + Office 2003 Pro SP2
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
Autofilter using a second column Robert Christie[_3_] Excel Programming 0 February 14th 06 01:48 PM
Need help hiding/unhiding column based on autofilter selection in a different column kcleere Excel Programming 1 January 23rd 06 06:21 AM
Extract AutoFilter Column Values? dwayneh Excel Discussion (Misc queries) 2 June 3rd 05 04:18 AM
Is it possible to use Autofilter, when column labels not in Row 1? Paul Moore Excel Discussion (Misc queries) 5 May 30th 05 07:22 PM
3 Criteria on one column in AutoFilter? CLR Excel Programming 2 February 27th 04 02:27 AM


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