Compile Error - Help

G

Guest

I'm new to Macros and programming. Why am I getting a compile error?

Sheets("Data").Select
Range("L3:U100").Select
Selection.ClearContents
Range("A18:J50000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=
Range ("A2:J4"), CopyToRange:=Range("L3:U100"), Unique:=False
Sheets("Search").Select
End Sub

Any help is greatly appreciated!!
 
G

Gary Keramidas

don't get a compile error, but i don't know if it works, either


Sheets("Data").Select
Range("L3:U100").Select
Selection.ClearContents
Range("A18:J50000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A2:J4"), CopyToRange:=Range("L3:U100"), Unique:=False
Sheets("Search").Select
End Sub
 
J

Jim Cone

You also need to add a new line at the top...
Sub SomeName
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Beginner"
wrote in message
I'm new to Macros and programming. Why am I getting a compile error?

Sheets("Data").Select
Range("L3:U100").Select
Selection.ClearContents
Range("A18:J50000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=
Range ("A2:J4"), CopyToRange:=Range("L3:U100"), Unique:=False
Sheets("Search").Select
End Sub

Any help is greatly appreciated!!
 
G

Guest

Is that End Sub line within your shell? Such that you have two End Sub lines
for your macro? If so, just remove the first one. VBA won't like two End
Subs in a row. If that's not it, can you reply giving the exact error
message you're getting.

Hope this helps.

Keith
 

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