![]() |
|
#2
|
|||
|
|||
|
.
This is one of many methods : In the Sheet Module paste : Code:
Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) TestInRange End Sub In a Regular Module paste : Code:
Option Explicit
Function InRange(Range1 As Range, Range2 As Range) As Boolean
' returns True if Range1 is within Range2
Dim InterSectRange As Range
Set InterSectRange = Application.Intersect(Range1, Range2)
InRange = Not InterSectRange Is Nothing
Set InterSectRange = Nothing
End Function
Sub TestInRange()
If InRange(ActiveCell, Range("H6:H81")) Then
' code to handle that the active cell is within the right range
ActiveCell.Offset(0, 1).Value = ""
Else
Exit Sub
End If
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retaining the left side space in table cell | kumarjeyabalan | Word Tables | 2 | 08-17-2019 03:14 AM |
Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow
|
FUGMAN | Excel Programming | 7 | 02-05-2017 08:37 AM |
If value of cell A Matches a value in a Range of cells (column) then add value of cell A to cell C
|
rick10r | Excel | 1 | 07-05-2016 12:07 PM |
Assign the value of a cell as a cell reference of another cell in Excel 2010 - How to?
|
bharathkumarst | Excel | 7 | 10-13-2014 10:25 AM |
| How do I align image at ABSOLUTE top left of a table cell? | shnoozin | Outlook | 0 | 07-22-2011 03:30 PM |