Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Little help with filter Please please!

Hi,

I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()

Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range

LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1

Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True

End Sub

Regards

Jay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Little help with filter Please please!

Where do you want the results to be placed,

one row below
or
one column right

In your code, you are trying place next row. Pl chk this

regards
KarthiGanesh

"James8309" wrote:

Hi,

I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()

Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range

LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1

Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True

End Sub

Regards

Jay

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Little help with filter Please please!

On Jun 16, 4:50*pm, kg_singapore
wrote:
Where do you want the results to be placed,

*one row below
or
one column right

In your code, you are trying place next row. *Pl chk this

regards
KarthiGanesh



"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


*Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
* * Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
* * ), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?

Can you help?

Thx
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Little help with filter Please please!

Did you check that there are sufficient rows below the last row of your data?
It may be one reason.

"James8309" wrote:

On Jun 16, 4:50 pm, kg_singapore
wrote:
Where do you want the results to be placed,

one row below
or
one column right

In your code, you are trying place next row. Pl chk this

regards
KarthiGanesh



"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?

Can you help?

Thx

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Little help with filter Please please!

On Jun 16, 5:17*pm, Karthi Ganesh
wrote:
Did you check that there are sufficient rows below the last row of your data?
It may be one reason.



"James8309" wrote:
On Jun 16, 4:50 pm, kg_singapore
wrote:
Where do you want the results to be placed,


*one row below
or
one column right


In your code, you are trying place next row. *Pl chk this


regards
KarthiGanesh


"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


*Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
* * Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
* * ), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?


Can you help?


Thx- Hide quoted text -


- Show quoted text -


Even if I do CopytoRange:=("C5") it returns the same error. column C:C
is totally empty.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Little help with filter Please please!

Sub Testing()

Dim LR As Integer
Dim LR1 As Integer
Dim Range123 As Range

LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1

Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("A" & LR1), _
Unique:=True

End Sub



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"James8309" wrote in message
...
On Jun 16, 5:17 pm, Karthi Ganesh
wrote:
Did you check that there are sufficient rows below the last row of your
data?
It may be one reason.



"James8309" wrote:
On Jun 16, 4:50 pm, kg_singapore
wrote:
Where do you want the results to be placed,


one row below
or
one column right


In your code, you are trying place next row. Pl chk this


regards
KarthiGanesh


"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why
it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?


Can you help?


Thx- Hide quoted text -


- Show quoted text -


Even if I do CopytoRange:=("C5") it returns the same error. column C:C
is totally empty.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Little help with filter Please please!

Hi,

I think you forget to put the word range ???
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True


change like this

Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("A" &
LR1 _
), Unique:=True


I hope you understood the error!

regards
KarthiGanesh


"James8309" wrote:

Hi,

I am trying to do an advance filter in VBA. I do not understand why it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()

Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range

LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1

Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True

End Sub

Regards

Jay

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Little help with filter Please please!

Good work Mr.Bob, you found the mistake at the first attempt.
Thanks a lot.

regards
Karthi Ganesh

"Bob Phillips" wrote:

Sub Testing()

Dim LR As Integer
Dim LR1 As Integer
Dim Range123 As Range

LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1

Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("A" & LR1), _
Unique:=True

End Sub



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"James8309" wrote in message
...
On Jun 16, 5:17 pm, Karthi Ganesh
wrote:
Did you check that there are sufficient rows below the last row of your
data?
It may be one reason.



"James8309" wrote:
On Jun 16, 4:50 pm, kg_singapore
wrote:
Where do you want the results to be placed,


one row below
or
one column right


In your code, you are trying place next row. Pl chk this


regards
KarthiGanesh


"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why
it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?


Can you help?


Thx- Hide quoted text -


- Show quoted text -


Even if I do CopytoRange:=("C5") it returns the same error. column C:C
is totally empty.



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Little help with filter Please please!

On Jun 16, 6:05*pm, Karthi Ganesh
wrote:
Good work Mr.Bob, you found the mistake at the first attempt.
Thanks a lot.

regards
Karthi Ganesh



"Bob Phillips" wrote:
Sub Testing()


Dim LR As Integer
Dim LR1 As Integer
Dim Range123 As Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


*Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
* * Range123.AdvancedFilter Action:=xlFilterCopy, _
* * * * * * * * * * * * * * CopyToRange:=Range("A" & LR1), _
* * * * * * * * * * * * * * Unique:=True


End Sub


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"James8309" wrote in message
...
On Jun 16, 5:17 pm, Karthi Ganesh
wrote:
Did you check that there are sufficient rows below the last row of your
data?
It may be one reason.


"James8309" wrote:
On Jun 16, 4:50 pm, kg_singapore
wrote:
Where do you want the results to be placed,


one row below
or
one column right


In your code, you are trying place next row. Pl chk this


regards
KarthiGanesh


"James8309" wrote:
Hi,


I am trying to do an advance filter in VBA. I do not understand why
it
is creating a "reference error" I am just trying to paste the unique
advanced filter result to the very last row + 1 on column A. Can
anyone help? Thanks alot!


Sub Testing()


Dim LR as Integer
Dim LR1 as Integer
Dim Range123 as Range


LR = Range("A65000").End(xlUp).Row
LR1 = LR + 1


Set Range123 = Sheets("Sheet1").Range("A2:A" & LR)
Range123.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=("A" &
LR1 _
), Unique:=True


End Sub


Regards


Jay- Hide quoted text -


- Show quoted text -


One row below the Last row. Why is it keep returning "Reference
error"?


Can you help?


Thx- Hide quoted text -


- Show quoted text -


Even if I do CopytoRange:=("C5") it returns the same error. column C:C
is totally empty.- Hide quoted text -


- Show quoted text -


omg, I am so dumb lol.

Thanks for your help guys! as always :D
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
Filter PivotTable dropdown items to match report filter Catherine D Excel Discussion (Misc queries) 1 August 16th 08 12:12 AM
filter: how to print filter list options in dropdown box help please Excel Discussion (Misc queries) 2 October 17th 07 01:53 AM
Extract filter items from Drop-Down Automatic Filter karpatov Excel Programming 1 February 26th 06 06:03 PM
Advance filter search does not filter an exact match cfiiland Excel Programming 1 June 10th 05 12:44 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM


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