ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro adding a range of percentages (https://www.excelbanter.com/excel-programming/385448-macro-adding-range-percentages.html)

rick_mc

Macro adding a range of percentages
 
Hi,

I need to import data at end of month and add percentages/totals. The
problem is the length of the columns will be dynamic so I need to calculate a
range of cells for which percentages and totals are required (see below
example). The 'TYPE' column will cause the report to lengthen as new types
are encountered month to month. I need to determine the number of
percentage/total cells per TYPE and add/replace any existing cells in each
column (jan count column will lengthen if feb has more TYPEs, so I have to
re-populate cells for totals/percentages). How do I dynamically get the range
of TYPE cells and use to place new formulas in percentage/total columns?

TYPE TOTAL JAN COUNT JAN % FEB COUNT FEB %
Call back 15 5 33% 10
66%
Dispatch 20 10 50% 10
50%
....


[email protected]

Macro adding a range of percentages
 
If you can rephrase your problem I am sure you may get some answers.

1. When you import your data what is the display of your sheet ?
ie. how many columns and what are the column labels ( jan feb
etc.)

2. "problem is the length of the columns will be dynamic so I need to
calculate a
range of cells for which percentages and totals are required
" ????

Do you insert new columns for totals and %'s ?

3. "jan count column will lengthen if feb has more TYPEs" ????,"so I
have to
re-populate cells for totals/percentages" ??????

I dont' think your problem is increasing the widht of a column.



All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com