Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to verify if a range (or a cell) is contained in another range
Hi all.
As above written, how can i get this? The issue is the follow: with VBA I extended conditional formatting with a lot of features, exceeding the normal 3 condition. Now I need this "personal conditional formatting" works only for the changed cell in a specific range and not in alla worksheet. Thank you in advance for tips, advice and suggestions. Nicola |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to verify if a range (or a cell) is contained in another range
From Immediate Window
? Not Application.Intersect(Range("Range1"),Range("Range 2")) is Nothing True << produced answer.. "Nicola M" wrote: Hi all. As above written, how can i get this? The issue is the follow: with VBA I extended conditional formatting with a lot of features, exceeding the normal 3 condition. Now I need this "personal conditional formatting" works only for the changed cell in a specific range and not in alla worksheet. Thank you in advance for tips, advice and suggestions. Nicola |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to verify if a range (or a cell) is contained in another range
Nicola,
One way is with worksheet change where you can capture the address of the cell that has changed and act accordingly. The code below only executes if the changed cell is in the range A1 - A100. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub 'If Not Intersect(Target, Range("A1:A100")) Is Nothing Then Application.EnableEvents = False 'do things Application.EnableEvents = True End If End Sub Mike "Nicola M" wrote: Hi all. As above written, how can i get this? The issue is the follow: with VBA I extended conditional formatting with a lot of features, exceeding the normal 3 condition. Now I need this "personal conditional formatting" works only for the changed cell in a specific range and not in alla worksheet. Thank you in advance for tips, advice and suggestions. Nicola |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to verify if a range (or a cell) is contained in another range
Sub ProperSubSet()
Dim littleRange As Range Dim bigRange As Range Dim r As Range Set littleRange = Range("A2:D9") Set bigRange = Range("A1:Z100") For Each r In littleRange If Intersect(r, bigRange) Is Nothing Then MsgBox ("Little not contained with Big") Exit Sub End If Next MsgBox ("Little contained with Big") End Sub -- Gary''s Student - gsnu200817 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to verify if a range (or a cell) is contained in another r
Thank you so much, guys. It's just that I was looking for
[CUT] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional formatting when text is contained in a named range | Excel Discussion (Misc queries) | |||
Verify Active Cell is within a Range that changes as cell is delet | Excel Programming | |||
Function to determine if any cell in a range is contained in a given cell | Excel Worksheet Functions | |||
How to verify a cell is in a named range | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming |