msquared99
07-27-2015, 11:42 AM
I have over 60 workbooks and each contains a named range called "Accruals". The named range spans from column A to column K but the start row and end row will be different in each workbook. For instance the named range is variable in each workbook A24:K52 or A26:K31 or A28:K44 and so on. The only thing that is consistent in each workbook is the named range "Accruals". There is data above and below the named range. In the named range "Accruals" columns A and B contain dates, columns C, E, G, I and K contain numbers. Above the named range in column A there is also some dates.
Looping through all the workbooks is not an issue. What I am trying to do is have a macro ask for a start and end date, look in column A of the named range "Accruals" for any dates between the start and end date and copy the matching row data to a summary workbook.
For instance I enter a date range of 6/1/2015 to 6/30/2015, the macro will look in the named range "Accruals", if a date between the start and end date if found in say row 34 or whatever row, it will copy the data from cells A34 or found row number and G34 or found row number into the summary workbook. The name of the workbook is in cell A2 of all the workbooks and I am looking to put that in the summary workbook as well.
Can someone steer me in the right direction?
I have both the start and end dates using an inputbox. It is the For/If loop that is getting me.
Looping through all the workbooks is not an issue. What I am trying to do is have a macro ask for a start and end date, look in column A of the named range "Accruals" for any dates between the start and end date and copy the matching row data to a summary workbook.
For instance I enter a date range of 6/1/2015 to 6/30/2015, the macro will look in the named range "Accruals", if a date between the start and end date if found in say row 34 or whatever row, it will copy the data from cells A34 or found row number and G34 or found row number into the summary workbook. The name of the workbook is in cell A2 of all the workbooks and I am looking to put that in the summary workbook as well.
Can someone steer me in the right direction?
I have both the start and end dates using an inputbox. It is the For/If loop that is getting me.