View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
gpmichal gpmichal is offline
external usenet poster
 
Posts: 19
Default new row with data from criteria

Oh...Ok. Can you simply use the folliwing "IF" formula in the cells in
Column "C"?

=IF(B1="blue",A1,"")

Let me know if that will do. If not, we can write some code to do the same
thing.

GP

"rafael" wrote:

hi

thanks for helping

i'm sorry - i tried your code but i was wrong - what i wanted was names in a
new column, not row ... :(

by the way: how will i control that future column?

ty

"gpmichal" escreveu:

Try this, Rafael,

Option Explicit

Sub ChooseEyeColor()

Dim i As Integer
Dim combo, name As String

i = 1

Do While Range("A" & i) < ""

If Range("B" & i) = "blue" Then
name = Range("A" & i)
combo = combo & name & ", "
End If

i = i + 1

Loop

Range("A4") = combo

End Sub

"rafael" wrote:

imagine i have two rows: name and color:
mary blue
ken brown
will blue

what i want is having, in another row, just the names that have blue eyes,
like
mary
will

thank you