cuiqin1234
New Member
- Joined
- Jul 9, 2011
- Messages
- 2
Hi, I need some help for the following VBA codes, there is always a error message says" there is not enough resources for completing this command" when i debug the codes, " ActiveSheet.paste" is highlighted.
Sub Hotel()
'
' Hotel Macro
'
Windows("Foodservice database final.xlsm").Activate
Sheets("Database").Select
Range("A1:AE1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$Y$5581").AutoFilter Field:=1, Criteria1:=Array( _
"5a", "5b", "5c"), Operator:=xlFilterValues
Range("A1").Select
Cells.Select
Selection.Copy
Workbooks.Add
Sheets(1).Select
Sheets(1).Name = "Hotel"
Sheets("Hotel").Select
ActiveSheet.paste
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub
Sub Hotel()
'
' Hotel Macro
'
Windows("Foodservice database final.xlsm").Activate
Sheets("Database").Select
Range("A1:AE1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$Y$5581").AutoFilter Field:=1, Criteria1:=Array( _
"5a", "5b", "5c"), Operator:=xlFilterValues
Range("A1").Select
Cells.Select
Selection.Copy
Workbooks.Add
Sheets(1).Select
Sheets(1).Name = "Hotel"
Sheets("Hotel").Select
ActiveSheet.paste
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub