Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set rng = Range("B6:K59")
if union(selection,rng).Address < "$B$6:$K$59" then ' selection is not totally within B6:K59 msgbox "Invalid selection" Else msgbox Format(Selection.count * 13.25,"£#,##0.00") End if -- Regards, Tom Ogilvy "rachy" wrote in message ... Can anyone help? I need to calculate the total of any selected cells which all have the same value. For example: I have created a shortcut key (macro) and used vb to program a simple fill function when the user selects any range of cells and hits ctrl+r. So say the user selects any range - say a 2 column by 10 row area B6 to B16 and C6 to C16. They then het ctrl+r - the area fills in red. If every cell is equal to 13.25 (£) can the total cost of that space be calculated and displayed? Again, the total needs to be able to be calculated anywhere within the cells B6 to K59 (each cell would be valued as 13.25 but this cannot appear on the spreadsheet). Summed up, I guess you could say I'm looking to calculate the cost of any selection defined by the user. I really am very lost! Hope this is clear! rach -- rachy ------------------------------------------------------------------------ rachy's Profile: http://www.excelforum.com/member.php...o&userid=15065 View this thread: http://www.excelforum.com/showthread...hreadid=267187 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculating ranges | New Users to Excel | |||
Calculating within Date Ranges | Excel Discussion (Misc queries) | |||
Calculating Date Ranges | Excel Worksheet Functions | |||
Calculating with named ranges | Excel Discussion (Misc queries) | |||
calculating date time ranges | Excel Worksheet Functions |