View Single Post
 
Old 06-22-2014, 05:25 AM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I'll probably need to ask more questions, shilabrow, but let's start here: This code appears to have at least two syntax errors in it:
Code:
Sub Prices()
  Selection.AutoFilter

  '                                    |
  ' Invalid space here --------------- v
  ActiveSheet.listObjects("MyDatabse"). Range.Autofilter Field:=4, Criteria1:="=yes", Operator:=xlOr, Criteria2:="="

  '                                                     |
  ' Missing argument name ("Field", I suppose) here --- v
  ActiveSheet.ListObjects("MyDatabase").Range.AutoFilter:=6, Criteria1:="=Complete", Operator:=xlOr,Criteria2:="="

  Cells.Select
  Selection.Copy
  Sheets("Result").Select
  Range("A1").Select
  ActiveSheet.Paste
  End sub
And judging by the capitalization, you didn't cut and paste it from the VBA editor but just typed it, some of it anyway, into here by hand.

Now, the real problem is that you're using features of which I'm ignorant; I don't know what ListObjects is and I almost never use Autofilter even manually. But before I ask more about those, can you show the real program, just to eliminate confusion (mine)? Better yet, can you just post the workbook?
Reply With Quote