PC Review


Reply
Thread Tools Rate Thread

Create List based on Cell Value

 
 
Steve
Guest
Posts: n/a
 
      10th Oct 2007
Hello. I'm trying to Scan column C for the word "Yes". If it finds
it, copy the contents of column R of the same row, and create a list
in Sheet2 one under the other.

Ideally, I would aslo love to have only unique values. Maybe that can
be done after the full list is created?

Thanks so much!!

 
Reply With Quote
 
 
 
 
JW
Guest
Posts: n/a
 
      10th Oct 2007
One way. This returns unique values and places them in the first
available row in column A of sheet 2.
Sub uniqueList()
Dim uVal As Collection, u As Variant
Set uVal = New Collection
For i = 2 To Cells(Rows.Count, 3).End(xlUp).Row
If UCase(Cells(i, 3).Text) = "YES" Then
On Error Resume Next
uVal.Add Cells(i, 18).Text, _
CStr(Cells(i, 18).Text)
On Error GoTo 0
End If
Next i
If uVal.Count = 0 Then Exit Sub
With Sheets("Sheet2")
For Each u In uVal
.Cells(.Rows.Count, 1).End(xlUp) _
.Offset(1, 0).Value = u
Next u
End With
Set uVal = Nothing
End Sub
Steve wrote:
> Hello. I'm trying to Scan column C for the word "Yes". If it finds
> it, copy the contents of column R of the same row, and create a list
> in Sheet2 one under the other.
>
> Ideally, I would aslo love to have only unique values. Maybe that can
> be done after the full list is created?
>
> Thanks so much!!


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create sorted list based on cell values Jon Microsoft Excel Misc 7 9th Oct 2009 07:30 AM
Create Cell Comment based on text in a cell on another worksheet =?Utf-8?B?RGF2ZSBGZWxsbWFu?= Microsoft Excel Misc 2 15th Mar 2007 09:49 AM
auto populate cell based on previous cell drop down list selectio. =?Utf-8?B?UHV6emxlZGJ5TGlzdHM=?= Microsoft Excel Misc 2 11th Sep 2006 01:28 AM
Create List based on cell data CWatsonJr Microsoft Excel Misc 3 20th Sep 2005 07:10 PM
I need to create a DYNAMIC list of values based on other cell cont =?Utf-8?B?THlubiBHLg==?= Microsoft Excel Worksheet Functions 2 19th Oct 2004 12:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:25 AM.