View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim May Jim May is offline
external usenet poster
 
Posts: 477
Default Intersect, Union... where's Deduct?

This is my favorite Personal.xls Macro
Highlite Area 1, Hold down Control key and
Highlite Area2, then run:

Sub Difference()
If Selection.Areas.Count 2 Then
MsgBox "Only Two Areas can be Selected. Try Again"
Else
MsgBox "Difference is " & Format(Application.Sum(Selection.Areas(1))
- Application.Sum(Selection.Areas(2)), "#,###.00")
End If
End Sub

"rumi" wrote:

Hi everybody!
I wonder if anyone knows how to deduct range from other range. You can
add ranges (Union method) or have their intersection (Intersect method)
but I didn't find a way to do something like I think it should be done
- Deduct(Range("A:A"),Range("A1:A2")) which would result with the range
A3:A65536.
Can anyone help?