Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Advanced filter macro error

Hi,

what does this gives an error.

Sub compare()
Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

'Range(Cells(1, 1), Cells(lr, lc)).Select


Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("new").Range(lr, lc), Unique:=False


please help
Thanks!
Boss
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Advanced filter macro error

Hi
Your criteria range
Sheets("new").Range(lr, lc)

is one cell.
Do you mean

Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

With Sheets("new")
'note the dots. No need to select and it won't help
Set CritRange = .Range(.Cells(1, 1), .Cells(lr, lc))
end with
Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Critrange, Unique:=False

regards
Paul


On Dec 15, 12:00*pm, Boss wrote:
Hi,

what does this gives an error.

Sub compare()
Sheets("new").Select
* * lr = Cells(65536, 1).End(xlUp).Row
* * lc = Range("IV1").End(xlToLeft).Column

'Range(Cells(1, 1), Cells(lr, lc)).Select

Sheets("old").Select
* * Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
* * * Sheets("new").Range(lr, lc), Unique:=False

please help
Thanks!
Boss


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Advanced filter macro error

Too good..

Defining range is something i thought but unable to code. Thanks for it..

Mean While i did something like this

Sub compare()
Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column


Sheets("old").Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range(Cells(1, 1), Cells(lr, lc)), Unique:=False

Sheets("old").Select
Range("a1").Select

End Sub

Thanks for your help
Boss

" wrote:

Hi
Your criteria range
Sheets("new").Range(lr, lc)

is one cell.
Do you mean

Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

With Sheets("new")
'note the dots. No need to select and it won't help
Set CritRange = .Range(.Cells(1, 1), .Cells(lr, lc))
end with
Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Critrange, Unique:=False

regards
Paul


On Dec 15, 12:00 pm, Boss wrote:
Hi,

what does this gives an error.

Sub compare()
Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

'Range(Cells(1, 1), Cells(lr, lc)).Select

Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("new").Range(lr, lc), Unique:=False

please help
Thanks!
Boss



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Advanced filter macro error

Hi in huge data the macro is failing. cound you please hepl..

Thanks!
Boss

"Boss" wrote:

Too good..

Defining range is something i thought but unable to code. Thanks for it..

Mean While i did something like this

Sub compare()
Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column


Sheets("old").Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range(Cells(1, 1), Cells(lr, lc)), Unique:=False

Sheets("old").Select
Range("a1").Select

End Sub

Thanks for your help
Boss

" wrote:

Hi
Your criteria range
Sheets("new").Range(lr, lc)

is one cell.
Do you mean

Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

With Sheets("new")
'note the dots. No need to select and it won't help
Set CritRange = .Range(.Cells(1, 1), .Cells(lr, lc))
end with
Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Critrange, Unique:=False

regards
Paul


On Dec 15, 12:00 pm, Boss wrote:
Hi,

what does this gives an error.

Sub compare()
Sheets("new").Select
lr = Cells(65536, 1).End(xlUp).Row
lc = Range("IV1").End(xlToLeft).Column

'Range(Cells(1, 1), Cells(lr, lc)).Select

Sheets("old").Select
Range("A1:p1044").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Sheets("new").Range(lr, lc), Unique:=False

please help
Thanks!
Boss



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
Error msg on Advanced Filter Helen Excel Discussion (Misc queries) 0 April 3rd 08 04:52 PM
Advanced Filter Error 1004 Matthew Excel Programming 2 January 18th 08 03:32 PM
Advanced Filter Error Floyd Bates[_2_] Excel Programming 1 July 6th 06 07:19 PM
Advanced Filter Error Claret Excel Programming 2 January 24th 06 03:40 PM
advanced filter error 1004 Tove Excel Programming 2 February 28th 05 07:22 PM


All times are GMT +1. The time now is 05:42 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"