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: 39
Default Filter based on named range cell - debug help required

I am trying to filter a sheet based on the named cell ("TeamData) on an
alternate sheet but keep getting a debug 'Object required' at the criteria
range. The debug recognises the value in the range as when hovering it shows
the correct text on the highlighted issue.

Detailed is the code:

Sub FilterSelection()

Sheets("Edit").Select

...AutoFilterMode =False

Columns("A:I").Select
Selection.AutoFilter
My_Range.AutoFilter Field:=1, Criteria1:="=" & Range("TeamData").Value
My_Range.AutoFilter Field:=2, Criteria1:="=" & Range("TeamData").Value

Range("A2:I500").Select
Selection.Copy
Sheets("Calculate").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Edit").Select

My_Range.AutoFilter Field:=2, Criteria1:="<" & Range("TeamData").Value

Rows("2:500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Calculate").Select
Range("A2").Select
ActiveSheet.Paste

End Sub

I am assuming there is a better way to copy and paste the selected data to
the other sheet based on what is returned but would not know where to start.

Column A is the team names, column B are the staff names but the team total
also has the team name in this column to make it easy to filter.

I have to filter the team total to the top of the page and then copy the
staff data below to make the rest of the spreadsheet work (not in this macro).

Any help would be appreciated
 
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
Filter data based on Cell Value - "" Syntax required Tracey Excel Programming 3 October 29th 09 05:30 AM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
How Do I Do an Exclude Filter based on a Named Range? Dawg House Inc Excel Worksheet Functions 8 April 11th 06 02:49 AM
Set range based on cell contents - help required N E Body[_4_] Excel Programming 5 July 27th 04 02:48 PM


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