Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Loop thru filtered sheet, copy unique values to another sheet

Hi,

Sub Macro5()
'

Dim nameRange As Range
Dim wksQB As Worksheet
Dim wksMDR As Worksheet
Dim var As Variant
Dim cell As Range

Set wksQB = ActiveWorkbook.Sheets("QueryBuster")
Set wksMDR = ActiveWorkbook.Sheets("MDR Worksheet")
Set nameRange = wksQB.Range("E2",
Range("A65536").End(xlUp)).SpecialCells(xlCellType Visible)

wksQB.Range(nameRange).Select

For Each cell In nameRange
var = Application.Match(cell, wksMDR.Columns(1), 0)
If Not IsError(var) Then GoTo NextVar
ActiveCell.Value = wksMDR.Range("A2",
Range("A65536").End(xlUp).Offset(1, 0)).Value
NextVar:
Next cell

End Sub
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
Copy entire row from another sheet onto first sheet if a unique text matches Smeghead Excel Worksheet Functions 1 March 14th 13 04:00 AM
copy unique values into listbox, then modify sheet from these values Matthew Dyer Excel Programming 4 September 28th 09 04:11 PM
Copy Paste from Class Sheet to Filtered List on Combined Sheet [email protected] Excel Programming 6 September 16th 08 04:30 PM
Copy rows with unique values to another sheet vmed Excel Programming 5 July 29th 06 08:18 PM
Counting Unique Cells When Spread Sheet is Filtered carl Excel Worksheet Functions 1 June 3rd 05 07:20 PM


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