Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ty for helping
i'm using: =IF(B1="blue";A1;"") but get a #NAME error, i guess if instead i use coma, i get a msg error saying formula has an error, which i cant sort out ... :( "gpmichal" wrote: 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rafael,
You're using semi-colons in your formula instead of commas. Try it after you make the change. GP "rafael" wrote: ty for helping i'm using: =IF(B1="blue";A1;"") but get a #NAME error, i guess if instead i use coma, i get a msg error saying formula has an error, which i cant sort out ... :( "gpmichal" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Look up Data by Row criteria and column criteria | Excel Worksheet Functions | |||
Sum data if 3 criteria are met | Excel Worksheet Functions | |||
looking up data in a table using 2 criteria | Excel Worksheet Functions | |||
under certain criteria copy data. | Excel Worksheet Functions | |||
Data Validation Criteria | Excel Programming |