Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copying unique values

1. I have a table with anything from 1 to 250 rows.

2. I want to Autofilter Column H so it will only copy
unique values. I then want to copy columns H, J and N to a
new sheet.

3. Also there is a title row in row 1 of the sheet which I
dont want to be copied.

4. The destination sheet is "AGTRN"

Thank you so much for your help.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Copying unique values

Jasminder,

Try the macro below. My assumption is that your data starts in row 1, and
the sheet with the data is the activesheet.

HTH,
Bernie
MS Excel MVP

Sub ExtractUniqueValues()
Dim mySheet As Worksheet
Set mySheet = ActiveSheet
Range("H1:H" & Range("H65536").End(xlUp).Row) _
.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Range("H1:N" & Range("H65536").End(xlUp).Row) _
.SpecialCells(xlCellTypeVisible).Copy
Sheets("AGTRN").Select
Range("A1").Select
ActiveSheet.Paste
Range("B1,D1:F1").EntireColumn.Delete
Range("A1").EntireRow.Delete
mySheet.ShowAllData
End Sub


"Jasminder Dhaliwal" wrote in message
...
1. I have a table with anything from 1 to 250 rows.

2. I want to Autofilter Column H so it will only copy
unique values. I then want to copy columns H, J and N to a
new sheet.

3. Also there is a title row in row 1 of the sheet which I
dont want to be copied.

4. The destination sheet is "AGTRN"

Thank you so much for your help.




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 Values, not Unique Records steph44haf Excel Discussion (Misc queries) 1 May 12th 10 07:52 PM
Count Unique Values but not Filtered or Hidden Values Lee Excel Worksheet Functions 3 June 2nd 09 11:18 PM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
create list of unique values from a column with repeated values? Chad Schaben Excel Worksheet Functions 1 July 8th 05 10:25 PM
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in test test Excel Programming 3 September 9th 03 08:53 PM


All times are GMT +1. The time now is 08:14 PM.

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"