![]() |
compile error: expected variable or function
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 |
Hi
which row is highlighted then you get this compile error -- Regards Frank Kabel Frankfurt, Germany MMM wrote: 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 |
I apologize, it is
cells.Select "Frank Kabel" wrote: Hi which row is highlighted then you get this compile error -- Regards Frank Kabel Frankfurt, Germany MMM wrote: 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 |
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. MMM wrote: I apologize, it is cells.Select "Frank Kabel" wrote: Hi which row is highlighted then you get this compile error -- Regards Frank Kabel Frankfurt, Germany MMM wrote: 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 -- Dave Peterson |
All times are GMT +1. The time now is 08:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com