View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
wblake0926 wblake0926 is offline
external usenet poster
 
Posts: 10
Default Macro Flexability

I apologize I did not label the columns
I need to find the percentage of each category total.
the number of categories differs
It appears what you sent worked Thanks a ton! sorry for the poor explanation.
C D
E
Technology & Electronics 2,187,500.00
Technology & Electronics 2,144,906.00
Technology & Electronics 2,275,625.00
Technology & Electronics Total 25,912,231.00 (% of Grand
Total)
Telecommunications 2,851,875.00
Telecommunications 1,734,000.00
Telecommunications 1,351,500.00
Telecommunications Total 5,937,375.00 (% of Grand
Total)
and so on



"Jim Thomlinson" wrote:

What goes in what columns? Just a short excerpt will do.
--
HTH...

Jim Thomlinson


"wblake0926" wrote:

Thanks for the quick response! R218C4 is the "Grand Total", it is the last
cell in column. Here is a small example of what the sheet looks like:


Short Term Investment Total 24,772,572.00
Technology & Electronics ( Tech ) 2,187,500.00
Technology & Electronics ( Tech ) 2,144,906.00
Technology & Electronics ( Tech ) 2,275,625.00
Technology & Electronics ( Tech ) 948,750.00
Technology & Electronics ( Tech ) 2,424,375.00
Technology & Electronics ( Tech ) 1,400,000.00
Technology & Electronics ( Tech ) 2,806,875.00
Technology & Electronics ( Tech ) 4,300,000.00
Technology & Electronics ( Tech ) 6,119,250.00
Technology & Electronics ( Tech ) 4,925,000.00
Technology & Electronics ( Tech ) 3,272,500.00
Technology & Electronics ( Tech ) Total 32,804,781.00
Telecommunications ( TCom ) 2,851,875.00
Telecommunications ( TCom ) 1,734,000.00
Telecommunications ( TCom ) 1,351,500.00
Telecommunications ( TCom ) 3,111,000.00
Telecommunications ( TCom ) 3,088,125.00
Telecommunications ( TCom ) 1,944,375.00
Telecommunications ( TCom ) 9,180,000.00
Telecommunications ( TCom ) 4,987,500.00
Telecommunications ( TCom ) 3,266,250.00
Telecommunications ( TCom ) 1,953,875.00
Telecommunications ( TCom ) 2,060,000.00
Telecommunications ( TCom ) 2,984,625.00
Telecommunications ( TCom ) 2,582,250.00
Telecommunications ( TCom ) 4,512,094.00
Telecommunications ( TCom ) 5,282,812.00
Telecommunications ( TCom ) 1,732,625.00
Telecommunications ( TCom ) 2,043,750.00
Telecommunications ( TCom ) 6,183,000.00
Telecommunications ( TCom ) Total 60,849,656.00
Utility ( Util ) 6,150,000.00
Utility ( Util ) 8,079,375.00
Utility ( Util ) 6,675,000.00
Utility ( Util ) Total 20,904,375.00

Grand Total 647,019,316.00

Thanks again!

"Jim Thomlinson" wrote:

What do you have in R218C4? If you are adding or deleting rows this is going
to move and we need some way to find it dynamically. Is it the last cell in
column 4 or does it have a title or ...
--
HTH...

Jim Thomlinson


"wblake0926" wrote:

Hello,
I am looking to make this macro a little more flexible, if I am to add or
remove data I want this to preform the same function. can anyone help me
adjust this so this is possible Thanks for the assistance
Sub Percentages()
'
' Percentages Macro
' Macro recorded 9/30/2009 by e447207
'

Cells.find(What:="Total", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
Range("E7").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E15").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E30").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E33").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E45").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E69").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E80").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E97").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E103").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E111").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
ActiveWindow.SmallScroll Down:=6
Cells.FindNext(After:=ActiveCell).Activate
Range("E113").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E132").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E164").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E179").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E181").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E193").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E212").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E216").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/R218C4"
Cells.FindNext(After:=ActiveCell).Activate
Range("E218").Select
Selection.FormulaR1C1 = "="
Range("E218").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-212]C:R[-1]C)"
End Sub