Error 1004

mr_baz

New Member
Joined
Oct 26, 2010
Messages
20
Hi guys,

I barely new with VBA and there's a problem with the code that I can't solve.

Here's the code ;

Sheets("Full list").Select
Selection.AutoFilter Field:=18, Criteria1:="OK"
ActiveSheet.ShowAllData
Selection.AutoFilter Field:=18, Criteria1:="OK"
ActiveWindow.SmallScroll ToRight:=-13
Selection.AutoFilter Field:=99, Criteria1:="OK"
Range("F6:K3000").Select
Selection.Copy
Sheets("common parts").Select
Range("F1").Select
ActiveSheet.Paste
Sheets("Full list").Select
Application.CutCopyMode = False
ActiveSheet.ShowAllData

Excel highlight me ; Range("F6:K3000").Select
as an error for now.

Does someone have an idea?

Thanks for any help
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
With sheet modules, any unqualified ranges (such as Range("F6:K3000") refer to the range on the sheet itself irrespective of whether this sheet is active or not. So you just need to qualify these ranges with the sheet on which they apppear:

Rich (BB code):
Sheets("Full list").Select
Selection.AutoFilter Field:=18, Criteria1:="OK"
ActiveSheet.ShowAllData
Selection.AutoFilter Field:=18, Criteria1:="OK"
ActiveWindow.SmallScroll ToRight:=-13
Selection.AutoFilter Field:=99, Criteria1:="OK"
Sheets("Full list").Range("F6:K3000").Select
Selection.Copy
Sheets("common parts").Select
Sheets("common parts").Range("F1").Select
ActiveSheet.Paste
Sheets("Full list").Select
Application.CutCopyMode = False
ActiveSheet.ShowAllData
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top