compile error: expected variable or function

G

Guest

I am getting the "Compile Error: Expected Variable or Function" when I try to
run the following:
Sub Belknap()
'
' Belknap Macro
' Macro recorded 10/28/2004 by Tina Ware
'
' Keyboard Shortcut: Ctrl+b
'
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Belknap").Select
cells.Select
Range("C1").Activate
Selection.ClearContents
Sheets("GOOD ONE").Range("p1:bw2449").AdvancedFilter
Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Counties").Range("A2:c3"),
CopyToRange:=Range("A1") _
, Unique:=False
ActiveWindow.SmallScroll ToRight:=9
Columns("O:bg").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub

I have used this command before, and actually recorded the macro again and I
still get the same error when I try to run it!!!! Help please, MMM
 
D

Dave Peterson

Is your procedure in a General module (not behind a worksheet or ThisWorkbook?)

If it is not, move it there and see if that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top