Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Adding Cell Value to another Sheet if...

On Sheet1 I have a column of account names and a column of dates of last vist
ie:

abc company 6/1/2007
xwz corp 4/15/2007
exl inc. 2/12/2007
aaa corp 6/5/2007
bbb inc. 6/11/2007

What I want to do is if the date of last visit is equal to month(today())
then I want it to list all of those accounts seperated by a comma on sheet2.
ie:

abc company, aaa corp, bbb inc.

Is that possible, if so how?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Adding Cell Value to another Sheet if...

As an alternative, perhaps one formulas play
which outputs the required list into a col in Sheet2?

Source data assumed in Sheet1 cols A and B, from row1 down,
with col A = companies, col B = dates (real dates assumed)

In Sheet2,

Put in A1:
=IF(Sheet1!B1="","",IF(MONTH(Sheet1!B1)=MONTH(TODA Y()),ROW(),""))

Put in B1:
=IF(ROW()COUNT($A:$A),"",INDEX(Sheet1!A:A,SMALL($ A:$A,ROW())))
Select A1:B1, copy down to cover the max expected extent of data in Sheet1,
say down to B100. Hide away col A. Col B will return the required list of
companies, all neatly bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Mike Pearson" wrote:
On Sheet1 I have a column of account names and a column of dates of last vist
ie:

abc company 6/1/2007
xwz corp 4/15/2007
exl inc. 2/12/2007
aaa corp 6/5/2007
bbb inc. 6/11/2007

What I want to do is if the date of last visit is equal to month(today())
then I want it to list all of those accounts seperated by a comma on sheet2.
ie:

abc company, aaa corp, bbb inc.

Is that possible, if so how?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Adding Cell Value to another Sheet if...

This should do it
Sub getmonthlydata()
For Each c In Range("e2:e" & Cells(Rows.Count, "e").End(xlUp).Row)
If Month(c) = Month(Date) Then
'MsgBox c.Address
ms = ms & ", " & c.Offset(, -1)
End If
Next c
'MsgBox Right(ms, Len(ms) - 1)
Sheets("sheet2").Range("d7") = Right(ms, Len(ms) - 1)
End Sub

--
Don Guillett
SalesAid Software

"Mike Pearson" <Mike
wrote in message
...
On Sheet1 I have a column of account names and a column of dates of last
vist
ie:

abc company 6/1/2007
xwz corp 4/15/2007
exl inc. 2/12/2007
aaa corp 6/5/2007
bbb inc. 6/11/2007

What I want to do is if the date of last visit is equal to month(today())
then I want it to list all of those accounts seperated by a comma on
sheet2.
ie:

abc company, aaa corp, bbb inc.

Is that possible, if so how?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Adding Cell Value to another Sheet if...

This looks like a great way to do it, I am just a little new at writing
macros. Would you mind please being a little more descriptive so that I can
figure out how to put this thing in. I really appreciate it.

"Don Guillett" wrote:

This should do it
Sub getmonthlydata()
For Each c In Range("e2:e" & Cells(Rows.Count, "e").End(xlUp).Row)
If Month(c) = Month(Date) Then
'MsgBox c.Address
ms = ms & ", " & c.Offset(, -1)
End If
Next c
'MsgBox Right(ms, Len(ms) - 1)
Sheets("sheet2").Range("d7") = Right(ms, Len(ms) - 1)
End Sub

--
Don Guillett
SalesAid Software

"Mike Pearson" <Mike
wrote in message
...
On Sheet1 I have a column of account names and a column of dates of last
vist
ie:

abc company 6/1/2007
xwz corp 4/15/2007
exl inc. 2/12/2007
aaa corp 6/5/2007
bbb inc. 6/11/2007

What I want to do is if the date of last visit is equal to month(today())
then I want it to list all of those accounts seperated by a comma on
sheet2.
ie:

abc company, aaa corp, bbb inc.

Is that possible, if so how?



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
VBA to stop XL from adding the Path Sring to Sheet-to-Sheet Links [email protected] Excel Discussion (Misc queries) 5 August 18th 06 01:46 PM
Adding in a cell from one sheet to another Stephen Sandor Excel Worksheet Functions 0 May 3rd 06 06:35 AM
Excel, adding figures from one cell to a summary sheet or workbook petercoe Excel Discussion (Misc queries) 5 April 28th 06 01:54 PM
Adding comments to unprotected cell in a protected sheet Dave Excel Discussion (Misc queries) 3 February 8th 06 10:59 PM
adding data from one sheet to another sheet as a dropdown list bo. gatorguy Excel Discussion (Misc queries) 1 February 18th 05 10:51 PM


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