I'd really appreciate some help on this one as I'm totally confused. I am using Microsot Excel 2003. The idea is fairly simple I have a large workbook, one spreadsheet of which (called review dates) is of client names with corresponding review dates (2 weekly, 3/6/12/18 monthly etc, etc). The columns are conditionally formatted to highlight any dates that fall within a week of the present date but its very time consuming and errror prone to scroll through hundreds of rows of client names plus across a number of columns looking for any due reviews. The idea is then to have a single summary worksheet report, to return all due actions detailing clients name, the date that a review is due and the type of review due, (eg 3 month). As stated any help at all would be good, I'm very new to VBA. Many thanks
A
Last edited by ambquinn; 06-13-2011 at 04:14 AM.
Hi A & Welcome to the Board,
My initial impression is a pivot-table. If this does not suit your needs then how about attaching a small sample workbook of what you have and what you desire.
http://www.pivot-table.com/
http://peltiertech.com/Excel/Pivots/pivottables.htm
HTH
Regards, Jeff
If you like the answer(s) provided, why not add some reputation by clicking the * below
Please use [ Code ] tags when posting [ /Code ]
Please view/read the Forum rules --- How to mark a thread as solved
Thanks for getting back to me. No, don't think a pivot table would suit the purpose. I have attached a small sample of what I'm looking for, (the actual one is a lot bigger with many more sheets). But essentially, its to return a "table" on the "summary actions due" spreadsheet detailing the client name, date action due and the type of review due, which is obviously based on data on the "review dates" sheet which is a dynamic table hundreds of rows long and may be up to 20 columns across.
Ok based on your sample, you only have one name, Callum. Any reason why only one name?
So in the end, do you want all names which are 7 days on either side of today's date along with the type of review?
Do you want the results wiped out everytime you rerun this macro? I don't see a formula that will do it, but that could just be my lack of understanding.
HTH
Regards, Jeff
If you like the answer(s) provided, why not add some reputation by clicking the * below
Please use [ Code ] tags when posting [ /Code ]
Please view/read the Forum rules --- How to mark a thread as solved
No, sorry I didn't make myself clear enough - I only put the one name (Callum) on the "summary actions due" sheet to show the kind of info that I would need returned from the "review dates" sheet ie the name, date and type of review, but it would need to return all those who fall preferably within 7 days either side of todays date or at least the 7 days prior to today. The macro would be ran once a week in an effort to get a comprehensive list of all due reviews that had to be booked in.
Thanks
A
I think this will do it:
Option Explicit Sub ReviewDates() Dim rd As Worksheet: Set rd = Sheets("review dates") Dim sadNextRow As Long Dim CheckDate As Date Dim rdLastRow As Long Dim rdLastCol As Long Dim cell As Range With Sheets("summary actions due") sadNextRow = .Range("B" & .Rows.Count).End(xlUp).Row + 1 End With With Sheets("review dates") CheckDate = .Range("B1").Value rdLastRow = .Range("A" & .Rows.Count).End(xlUp).Row rdLastCol = .Cells(3, .Columns.Count).End(xlToLeft).Column For Each cell In .Range("b4", .Cells(rdLastRow, rdLastCol)) If cell.Value >= CheckDate - 7 _ And cell.Value <= CheckDate + 7 _ Then With Sheets("summary actions due") .Range("C" & sadNextRow).Value = cell.Value .Range("B" & sadNextRow).Value = rd.Cells(cell.Row, 1) .Range("D" & sadNextRow).Value = rd.Cells(3, cell.Column) sadNextRow = sadNextRow + 1 End With End If Next 'cell End With End Sub
Regards
Thank you TMShucks for the assist.
@A: Please let us know if this meets your needs
HTH
Regards, Jeff
If you like the answer(s) provided, why not add some reputation by clicking the * below
Please use [ Code ] tags when posting [ /Code ]
Please view/read the Forum rules --- How to mark a thread as solved
That is absolutely brilliant! Works a treat many many thanks to both - it was completely doing my head in!![]()
You're welcome. Thanks for the rep.
If this answers your question, please mark your thread as solved. See my signature for details or the FAQ.
Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks