trying to copy a range -problem in selecting the range

navyaa

Board Regular
Joined
Jul 7, 2002
Messages
223
I am trying to select a cells br3 to bs2000 which are on sheets MACROS and then after selecting them, i filter the columns based on a criteria and then finally i need to copy them over.

This is the code i have but there is some problem as it gives an error while selecting the cells...

Sheets("macros").Select
Range(br3, bs2000).Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd
Selection.Copy
ActiveWindow.SmallScroll Down:=-12
Range("BT3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("BR3").Select
Selection.AutoFilter

Please let me know whats wrong with this??
thank you:)
Navya
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
On 2002-10-08 17:24, navyaa wrote:
I am trying to select a cells br3 to bs2000 which are on sheets MACROS and then after selecting them, i filter the columns based on a criteria and then finally i need to copy them over.

This is the code i have but there is some problem as it gives an error while selecting the cells...

Sheets("macros").Select
Range(br3, bs2000).Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd
Selection.Copy
ActiveWindow.SmallScroll Down:=-12
Range("BT3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("BR3").Select
Selection.AutoFilter

Please let me know whats wrong with this??
thank you:)
Navya

try a : instead of a , in your range selection
 
Upvote 0
Thank you for your response...

Do you mean i should try using :
Range(br3:bs2000).Select

instead of Range(br3, bs2000).Select ???

I tried it but still gives me an error.

Thank you.
 
Upvote 0
enter in the range like this
Range("BR3:BS2000").Select
this should do the trick Thanks Johny
 
Upvote 0

Forum statistics

Threads
1,217,448
Messages
6,136,686
Members
450,024
Latest member
Beagle263

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