macro help

J

Jerie

I have this macro as follows

Sub Copy_ESM_Prices()
'
' Keyboard Shortcut: Ctrl+t
'
Sheets("Dump").Select
Application.Goto Reference:="R1C1"
ActiveSheet.Paste
Application.Goto Reference:="ClippedGrid"
ActiveWindow.LargeScroll Down:=0
ActiveWindow.ScrollRow = 1
Selection.Sort Key1:=Range("B3"), Order1:=xlAscending,
Key2:=Range("B3") _
, Order2:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
ActiveWindow.SmallScroll ToRight:=1
ActiveWindow.LargeScroll ToRight:=-1

Sheets("TAB1").Select
Application.Goto Reference:="R1C1"
Range("Pricesv3.xls!ClippedGrid").AdvancedFilter
Action:=xlFilterCopy, _
CriteriaRange:=Range("A2:A3"), CopyToRange:=Range
("B2"), Unique:=False
Sheets("TAB2").Select
Application.Goto Reference:="R1C1"
Range("Pricesv3.xls!ClippedGrid").AdvancedFilter
Action:=xlFilterCopy, _
CriteriaRange:=Range("A2:A3"), CopyToRange:=Range
("B2"), Unique:=False
Sheets("TAB3").Select
Application.Goto Reference:="R1C1"
Range("Pricesv3.xls!ClippedGrid").AdvancedFilter
Action:=xlFilterCopy, _
CriteriaRange:=Range("A2:A3"), CopyToRange:=Range
("B2"), Unique:=False
Sheets("Dump").Select
End Sub

When I remove the section from :- sheets("tab1").select -:
down to :- sheets("dump").select (as per example)
The macro does not work.

Sub Copy_ESM_Prices()

'
' Keyboard Shortcut: Ctrl+t

'
Sheets("Dump").Select

Application.Goto Reference:="R1C1"

ActiveSheet.Paste

Application.Goto Reference:="ClippedGrid"

ActiveWindow.LargeScroll Down:=0

ActiveWindow.ScrollRow = 1

Selection.Sort Key1:=Range("B3"), Order1:=xlAscending,
Key2:=Range("B3") _

, Order2:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:= _

False, Orientation:=xlTopToBottom

ActiveWindow.SmallScroll ToRight:=1

ActiveWindow.LargeScroll ToRight:=-1

Sheets("Dump").Select

End Sub

Can any body help me please.

your help will be very much appreciated

Thank You

Rgs Jerie
 
N

Nick Hodge

Jerie

What error are you getting, what line does it fail on?

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top