Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default List cell values seperated by comma if criteria met

I created a sheet as below:

A B
1 Company Name When Approved
2 ABC Company 6/1/07
3 XyZ Inc 5/1/07
4 aaa LLC 6/2/07
5 aba Company 4/20/07

There's a lot of other info but these are the columns i want to use for this
formula.

Anyway what I want to happen is if month(A2:A5) = month(today()) then I want
it to list the name of those companies on sheet2 a1 with each name seperated
by a comma.

Do I need to make a macro to do that or is there a formula that can do this?

Even if it has to list them down a column that would be fine as long as
there are no gaps in between. I figured out a way to do it but it just
leaves a blank cell if false, so it may have one company name and then 20
blank rows and then another company name???

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default List cell values seperated by comma if criteria met

2 solutions at your other post

Biff

"Mike Pearson" wrote in message
...
I created a sheet as below:

A B
1 Company Name When Approved
2 ABC Company 6/1/07
3 XyZ Inc 5/1/07
4 aaa LLC 6/2/07
5 aba Company 4/20/07

There's a lot of other info but these are the columns i want to use for
this
formula.

Anyway what I want to happen is if month(A2:A5) = month(today()) then I
want
it to list the name of those companies on sheet2 a1 with each name
seperated
by a comma.

Do I need to make a macro to do that or is there a formula that can do
this?

Even if it has to list them down a column that would be fine as long as
there are no gaps in between. I figured out a way to do it but it just
leaves a blank cell if false, so it may have one company name and then 20
blank rows and then another company name???

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default List cell values seperated by comma if criteria met

How about:

Sub mike()
Dim d As Date
Dim s As String
s = ""
m = Month(Now())
n = Cells(Rows.Count, "B").End(xlUp).Row
first = True
For i = 2 To n
m1 = Month(Cells(i, "B").Value)
If m1 = m Then
If first Then
first = False
s = Cells(i, "A").Value
Else
s = s & "," & Cells(i, "A").Value
End If
End If
Next
Sheets("Sheet2").Range("A1").Value = s
End Sub

--
Gary''s Student - gsnu200726
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
Exctracting comma seperated data from a single cell guyvanzyl Excel Discussion (Misc queries) 3 June 30th 06 12:18 PM
Find the sum of Comma Seperated Values In a Cell xcelion Excel Worksheet Functions 3 August 24th 05 07:55 AM
Sum of comma seperated values in cell(Reposting) xcelion Excel Worksheet Functions 3 August 22nd 05 01:16 PM
Put all cells in one cell seperated by comma kokopoko New Users to Excel 6 August 6th 05 03:03 AM
column values to a cell with comma seperated Raju Boine. Excel Worksheet Functions 3 July 27th 05 03:30 PM


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