domiereavron
New Member
- Joined
- Apr 11, 2013
- Messages
- 22
Hello
I am working on file that has gotten way too large for a project.
Here is a sample version of the project
https://docs.google.com/file/d/0B5ivitjLxD8EZXc0MnBJWS10bVU/edit?usp=sharing
I am hoping to shrink down the file size using VBA. I have excel files for each day this year that contain all stats of each of our workers. The files have been named in a YYYY-MM-DD format. So August 1, 2013 would be 2013-08-01. On my main page, the user can enter their Start Date and how many days they would like to see stats for and enter the associate names on the left side. The report generates the header columns for each day the user is requesting stats. In my other tabs. The column header is created based on the associate names that were entered. Each day of this year is listed down the row in the first column.
In each cell, there is a formula, =IF(AND(B$1<>0, COUNTIF(Main!$4:$4,CALLS!$A10)>0), INDEX('\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-09.xlsx]2013-01-09'!$F:$F, MATCH(B$1,'\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-09.xlsx]2013-01-09'!$A:$A, 0)), "")
Basically it is saying if the date is found on the main page, and the associate is listed on top, do an index match search on this file. The file location is static and is always \\10.20.48.39\dc$\analytics\stats\rams\stats\
and the column it is indexing and matching is always the same.
Does anyone have an idea how to write VBA so that it would just generate the dates for each column header and write the link for each cell on the main tab to grab the data. So if the user entered in January 1st, 2013 for the start date and 10 days, it create the dates based on what was entered for the start date and how many dates as seen below:
[TABLE="width: 680"]
<TBODY>[TR]
[TD="align: right"]1/1/2013</SPAN>[/TD]
[TD="align: right"]1/2/2013</SPAN>[/TD]
[TD="align: right"]1/3/2013</SPAN>[/TD]
[TD="align: right"]1/4/2013</SPAN>[/TD]
[TD="align: right"]1/5/2013</SPAN>[/TD]
[TD="align: right"]1/6/2013</SPAN>[/TD]
[TD="align: right"]1/7/2013</SPAN>[/TD]
[TD="align: right"]1/8/2013</SPAN>[/TD]
[TD="align: right"]1/9/2013</SPAN>[/TD]
[TD="align: right"]1/10/2013</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL span=10></COLGROUP>[/TABLE]
[TABLE="width: 124"]
<TBODY>[TR]
[TD]Smith, Robert</SPAN>[/TD]
[/TR]
[TR]
[TD]Dankins, Jason</SPAN>[/TD]
[/TR]
[TR]
[TD]Simpson, Homer</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
Beside each name it would create the look up link for the data based on the date for each column.
INDEX('\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-01.xlsx]2013-01-01'!$F:$F, MATCH(A5,'\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-01.xlsx]2013-01-01'!$A:$A, 0)), "")
I dont know if that makes sense, but it would greatly cut down on the size of the file. Since it is currently using a massive lookup table, the file is 12 mb.
Any help is appreciated.
I am working on file that has gotten way too large for a project.
Here is a sample version of the project
https://docs.google.com/file/d/0B5ivitjLxD8EZXc0MnBJWS10bVU/edit?usp=sharing
I am hoping to shrink down the file size using VBA. I have excel files for each day this year that contain all stats of each of our workers. The files have been named in a YYYY-MM-DD format. So August 1, 2013 would be 2013-08-01. On my main page, the user can enter their Start Date and how many days they would like to see stats for and enter the associate names on the left side. The report generates the header columns for each day the user is requesting stats. In my other tabs. The column header is created based on the associate names that were entered. Each day of this year is listed down the row in the first column.
In each cell, there is a formula, =IF(AND(B$1<>0, COUNTIF(Main!$4:$4,CALLS!$A10)>0), INDEX('\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-09.xlsx]2013-01-09'!$F:$F, MATCH(B$1,'\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-09.xlsx]2013-01-09'!$A:$A, 0)), "")
Basically it is saying if the date is found on the main page, and the associate is listed on top, do an index match search on this file. The file location is static and is always \\10.20.48.39\dc$\analytics\stats\rams\stats\
and the column it is indexing and matching is always the same.
Does anyone have an idea how to write VBA so that it would just generate the dates for each column header and write the link for each cell on the main tab to grab the data. So if the user entered in January 1st, 2013 for the start date and 10 days, it create the dates based on what was entered for the start date and how many dates as seen below:
[TABLE="width: 680"]
<TBODY>[TR]
[TD="align: right"]1/1/2013</SPAN>[/TD]
[TD="align: right"]1/2/2013</SPAN>[/TD]
[TD="align: right"]1/3/2013</SPAN>[/TD]
[TD="align: right"]1/4/2013</SPAN>[/TD]
[TD="align: right"]1/5/2013</SPAN>[/TD]
[TD="align: right"]1/6/2013</SPAN>[/TD]
[TD="align: right"]1/7/2013</SPAN>[/TD]
[TD="align: right"]1/8/2013</SPAN>[/TD]
[TD="align: right"]1/9/2013</SPAN>[/TD]
[TD="align: right"]1/10/2013</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL span=10></COLGROUP>[/TABLE]
[TABLE="width: 124"]
<TBODY>[TR]
[TD]Smith, Robert</SPAN>[/TD]
[/TR]
[TR]
[TD]Dankins, Jason</SPAN>[/TD]
[/TR]
[TR]
[TD]Simpson, Homer</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
Beside each name it would create the look up link for the data based on the date for each column.
INDEX('\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-01.xlsx]2013-01-01'!$F:$F, MATCH(A5,'\\10.20.48.39\dc$\Analytics\Stats\RAMS\Stats\[2013-01-01.xlsx]2013-01-01'!$A:$A, 0)), "")
I dont know if that makes sense, but it would greatly cut down on the size of the file. Since it is currently using a massive lookup table, the file is 12 mb.
Any help is appreciated.