Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Summarising figures - can anyone help please

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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Summarising figures - can anyone help please

Tom,

Thanks very much,that is excellent. However is it possible to include
the option to select which color to highlight the cell or change the
color each time its run.

Basically, it works fine the first time i summarise the data but if i
want to summarise two sets of data within the same range i am left with
two summaries with the same color - which confuses the issue somewhat!

Once again, many thanks - it is very much appreciated


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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 & ")"
rng1.Offset(0, 1).Select
Application.Dialogs(xlDialogPatterns).Show
rng.Interior.ColorIndex = _
rng1.Offset(0, 1).Interior.ColorIndex
End Sub

--
Regards,
Tom Ogilvy


Tom Ogilvy wrote in message
...
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/





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summarising Data Murray Excel Worksheet Functions 5 August 16th 08 04:17 PM
Summarising Timesheets Jayjay Excel Worksheet Functions 1 December 4th 07 05:42 PM
add figures to existing figures in excel Barkster Excel Worksheet Functions 0 June 21st 06 02:54 PM
Changing positive figures to minus figures Louise Excel Worksheet Functions 2 September 14th 05 10:05 AM
Summarising scores Sheila Excel Worksheet Functions 3 May 12th 05 11:56 PM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"