Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default new row with data from criteria

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default new row with data from criteria

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default new row with data from criteria

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   Report Post  
Posted to microsoft.public.excel.programming
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default new row with data from criteria

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default new row with data from criteria

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
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
Look up Data by Row criteria and column criteria Jason Excel Worksheet Functions 2 December 16th 09 03:13 AM
Sum data if 3 criteria are met rdbjr99 Excel Worksheet Functions 4 March 26th 08 06:10 PM
looking up data in a table using 2 criteria Willem Excel Worksheet Functions 0 September 19th 07 03:16 PM
under certain criteria copy data. dave Excel Worksheet Functions 2 November 16th 04 02:56 AM
Data Validation Criteria taych[_3_] Excel Programming 4 April 26th 04 08:07 PM


All times are GMT +1. The time now is 01:03 AM.

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"