ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   compile error: expected variable or function (https://www.excelbanter.com/excel-discussion-misc-queries/2503-compile-error-expected-variable-function.html)

MMM

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

Frank Kabel

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




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





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.


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 04:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com