Formula/vba

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:38 PM GMT

Question

I have a large database that contains patient names along with a date (as well as other information). Id like to be able to have all rows that contain dates from a specific month to automatically populate on another spreadsheet without having to copy paste them. I'm not sure if this a formula or if it is vba. Im not very familiar with vba but I am sure I can figure it out if you give a detailed explanation of the writing process. I am able to open vba and get it all set up but to write the code....not to sure Here's what my database looks like

Name Date Area Time Jane Doe 23/01/2010 Sudbury 10:00 Jane Doe 16/01/2010 Sudbury 9:35 John Smith 01/03/2010 Sudbury 10:11

So I would like to seperate each of these date onto seperate worksheets. So all colums with appointments that were in january 2010 on one spreadsheet, then on another all feb, and so on.

Answer

I would recommend that you create a pivot table. First I would add a column to your data with the month; it would be a formula =MONTH(date cell) and should return a number between 1 and 12. You could simply filter on that column or you could make that column a page field in a pivot table and you would essentially have the same thing as a page for each month. Spreading your data across 12 sheets really eliminates a lot of the benefits of the spreadsheet.

If you really need a code to take nice tabular data and spread it around 12 sheets, we would have to know how often you wanted to do it, and if you were going to augment existing monthly data or create new monthly data from scratch.

It really won't be too hard but I recommend you try a filter or a pivot table first.

Advertisement

©2024 eLuminary LLC. All rights reserved.