Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Compile Error - Help

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!!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Compile Error - Help

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

--


Gary


"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!!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Compile Error - Help

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!!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Compile Error - Help

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

"Beginner" wrote:

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!!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"