View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Summarising figures - can anyone help please

Sub Tester10()
Dim rng As Range, rng1 As Range
Set rng = Selection
Set rng1 = rng.Areas(rng.Areas.Count)
Set rng1 = rng1(rng1.Rows.Count, rng1.Columns.Count)
rng1.Offset(0, 1).Formula = "=Sum(" & rng.Address & ")"
Union(rng, rng1.Offset(0, 1)).Interior.ColorIndex = 5

End Sub

This is sensative to the order you select your cells.



--
Regards,
Tom Ogilvy


ian123 wrote in message
...
I'd like to create a macro that allows me to do the following but i'm a
bit stuck - can anyone help?

I want to be able to select some numeric cells (a1, a7 a12, a56 for
exampel) and then run a macro which will sum the amounts and place the
total in the cell that is immediately to the right of the last cell
selected in the sum (eg, b56)

However, in addition to this i want all of these cells (a1,a7, a12, a56
and b56) to be highlighted in someway to show that they are linked -
i'm thinking a change of background color or the use of a numbered
key.

Any help on this would be very much appreciated


---
Message posted from http://www.ExcelForum.com/