Hello All. First Time here and very limited with VBA code. I am an administrator for a Police Department and I use excel spreadsheets to keep statistics of officer's daily activities. So I made up a spreadsheet called a patrol log that they each file out electronically and save to a folder on the network called "Patrol Logs". They save them in the format "mm-dd-yy LastName". I then take the data from approximately 20 cells and type it into my stats WB.
My Stats WB has tabs for each officer. Left side has each date for the year and the top has headers for each stat I am tracking. so data for jan 1, 2015 starts at D5 and goes to AA5. and continues stepping by 1 all the way down to dec 31, 2015.
I want to make a Macro that looks at each officers tab, and each date and finds the file with that name, copies the data in about 20 cells, and inputs it into the proper row.
First question is, is this possible.
Second question is, if so, is it easy enough to program?
Could someone give me an example as to how to first, open a file based on the current sheet and a continuous set of dates. and then copy only a couple of the cells and input them into that corresponding row.
If I get that much, I can probably get the rest to fall into place.
I know that the following will give me the sheet name:
pName = ActiveWorkbook.Path
wbName = ActiveWorkbook.Name
shtName = ActiveSheet.Name
shtName = ActiveWorkbook.Worksheet.Name
But I can't figure out how to go about getting the date and then smushing the two together to even find the file.
My Stats WB has tabs for each officer. Left side has each date for the year and the top has headers for each stat I am tracking. so data for jan 1, 2015 starts at D5 and goes to AA5. and continues stepping by 1 all the way down to dec 31, 2015.
I want to make a Macro that looks at each officers tab, and each date and finds the file with that name, copies the data in about 20 cells, and inputs it into the proper row.
First question is, is this possible.
Second question is, if so, is it easy enough to program?
Could someone give me an example as to how to first, open a file based on the current sheet and a continuous set of dates. and then copy only a couple of the cells and input them into that corresponding row.
If I get that much, I can probably get the rest to fall into place.
I know that the following will give me the sheet name:
pName = ActiveWorkbook.Path
wbName = ActiveWorkbook.Name
shtName = ActiveSheet.Name
shtName = ActiveWorkbook.Worksheet.Name
But I can't figure out how to go about getting the date and then smushing the two together to even find the file.