## Abstract

You can easily combine two ranges with Union, you can get their common parts with Intersect - but if you need to get all cells which are in Range1 but not in Range2:

## Example

```
Sub test()
Dim v As Variant
Worksheets("Sheet1").Activate
For Each v In sbRLess(Range("A1:D4"), Range("B2:C3"))
Debug.Print v.Address
Next v
End Sub
```

will result in

```
$A$1
$B$1
$C$1
$D$1
$D$2
$D$3
$A$2
$A$3
$A$4
$B$4
$C$4
$D$4
```

## Appendix – sbRLess Code

Please read my Disclaimer.

```
Option Explicit
Function sbRLess(r1 As Range, r2 As Range) As Range
'Returns all cells in r1 which are not in r2.
'Can return a multi-range.
'Source (EN): http://www.sulprobil.com/sbrless_en/
'Source (DE): http://www.bplumhoff.de/sbrless_de/
'(C) (P) by Bernd Plumhoff 06-May-2020 PB V0.30
Dim v As Variant, r As Range, r3 As Range
Dim bFirst As Boolean
Set r3 = Application.Intersect(r1, r2)
If r3 Is Nothing Then
Set sbRLess = r1
Exit Function
End If
bFirst = True
For Each v In r1
If Application.Intersect(r3, v) Is Nothing Then
If bFirst Then
Set r = v
bFirst = False
Else
Set r = Application.Union(r, v)
End If
End If
Next v
Set sbRLess = r
End Function
```