Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Advanced Filter - Unique Values

I am trying to put together a macro which will run an Advance filter and
bring back unique records. I need it to work on an range which may increase
or decrease. the code below works sometimes but depends I think what cell is
active when the macro is run.

Sub Test()
Dim Irange As Range
Dim ORange As Range
FinalRow = Cells(65536, 1).End(xlUp).Row
NextCol = Cells(1, 255).End(xlToLeft).Column + 2
Range(Selection, Selection.End(xlToRight)).Copy Destination:=Cells(1, NextCol)
Set ORange = Cells(1, NextCol)
Set Irange = Range("a1").Resize(FinalRow, NextCol - 2)
Irange.AdvancedFilter Action:=xlFilterCopy, copytorange:=ORange, Unique:=True
End Sub

Any ideas? Thank you for your help.

Esther
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Advanced Filter - Unique Values

Range("A1").CurrentRegion.AdvancedFilter _
Action:=xlFilterCopy, copytorange:=ORange, Unique:=True

is a possibility
--
Regards,
Tom Ogilvy

"EstherJ" wrote in message
...
I am trying to put together a macro which will run an Advance filter and
bring back unique records. I need it to work on an range which may

increase
or decrease. the code below works sometimes but depends I think what cell

is
active when the macro is run.

Sub Test()
Dim Irange As Range
Dim ORange As Range
FinalRow = Cells(65536, 1).End(xlUp).Row
NextCol = Cells(1, 255).End(xlToLeft).Column + 2
Range(Selection, Selection.End(xlToRight)).Copy Destination:=Cells(1,

NextCol)
Set ORange = Cells(1, NextCol)
Set Irange = Range("a1").Resize(FinalRow, NextCol - 2)
Irange.AdvancedFilter Action:=xlFilterCopy, copytorange:=ORange,

Unique:=True
End Sub

Any ideas? Thank you for your help.

Esther



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Advanced Filter - Unique Values

Hi Tom,

I have an almost similar requirement.I have two worksheets input and
output.
my input worksheet contains many rows with
"Price" "Item" "vendor" "Vendor Address"

30 Pencil ebay
45 Pencil my_store
75 Pencil other_store
80 Pen ebay
80 Pen my_store
35 Pen other_store
########
Need a Button in output worksheet that will give me only the lowest
values of items in this output worksheet.
input worksheet needs to be unchnaged.
Please help how i can do this.


Tom Ogilvy wrote:
Range("A1").CurrentRegion.AdvancedFilter _
Action:=xlFilterCopy, copytorange:=ORange, Unique:=True

is a possibility

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Who are in??

Hi Vba Gurus,
I have an Attendance application that feeds data dynamically of users
in our office to an excel sheet named input.(Rows added on the fly.

Example as Follows:-

"User_Name" "Time" "IN/OUT" "Location"
Jack 09:30 in 3rd floor Lobby
Joe 09:25 in 3rd Floor Lobby
Jill 07:25 in 5th floor Lobby
Sant 11:00 in 6th floor Gym
Jack 13:00 out 3rd floor Exit
Romi 08:00 in 5th floor lobby
Sushil 09:00 in 4th floor lobby
Joe 11:00 out 5th Floor exit
Romi 14:00 out 6th floor exit
Jack 14:50 in 3rd floor lobby
Joe 15:00 out somewhere
Jill 16:00 out somethingelse
Jack 17:00 out 4th floor exit
Sushil 18:00 out
---
---
################################################## ############
Now i want to update another sheet in same excel workbook named output
based on the above input.

- A button when clicked in this output sheet,Should process the input
worksheet and give me two sections
- Users those are in the building with latest in time and latest location
- Users those who are outside the building with latest out time and exit
point




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default last status of row data and new worksheet write


Hi Vba Gurus,
Please see if you can help me in this.
I have an Attendance application that feeds data dynamically of users
in our office to an excel sheet named worksheet1.(Rows added on the fly.)

Example as Follows:-

"User_Name" "Time" "IN/OUT" "Location"

Jack 09:30 in 3rd floor Lobby
Joe 09:25 in 3rd Floor Lobby
Jill 07:25 in 5th floor Lobby
Sant 11:00 in 6th floor Gym
Jack 13:00 out 3rd floor Exit
Romi 08:00 in 5th floor lobby
Sushil 09:00 in 4th floor lobby
Joe 11:00 out 5th Floor exit
Romi 14:00 out 6th floor exit
Jack 14:50 in 3rd floor lobby
Joe 15:00 out somewhere
Jill 16:00 out somethingelse
Jack 17:00 out 4th floor exit
Sushil 18:00 out 6th floor exit
Jack 19:00 in 4th floor exit
Sant 20:00 in 6th floor Gym


---
---
################################################## ############
Now i want to know the latest (last) status of users based upon current
time to be updated in worksheet2.
This worksheet2 need to be updated as and when new rows are added in
input worksheet1.
OR
- A button when clicked in this worksheet2,Should process the input
worksheet1 and write to worksheet2.

########### Worksheet2 Sample output#######

INS
############################################

"User_Name" "Time" "IN/OUT" "Location"
Jack 19:00 in 4th floor exit
Sant 20:00 in 6th floor Gym

OUTS
################################################## ##
Joe 15:00 out somewhere
Jill 16:00 out somethingelse
Romi 14:00 out 6th floor exit
Sushil 18:00 out 6th floor exit
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
unique records by advanced filter Stefi Excel Discussion (Misc queries) 10 October 5th 09 08:04 AM
Advanced Filter - extracting unique records Balan Excel Worksheet Functions 2 September 4th 07 03:12 AM
Concatenate Unique advanced filter results SteveT Excel Discussion (Misc queries) 1 August 15th 06 03:17 PM
Error using Advanced Filter Unique Records headly Excel Discussion (Misc queries) 5 May 9th 06 01:36 AM
Inconsistent Results: Advanced Filter Unique Records Only KB Excel Discussion (Misc queries) 1 March 25th 05 02:34 PM


All times are GMT +1. The time now is 01:29 AM.

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

About Us

"It's about Microsoft Excel"