Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Checks each changed cell and displays a message box if the cell is within the desired range

Private Sub Worksheet_Change(ByVal Target As Excel.Range)     Set VRange = Range("InputRange")     For Each cell In Target         If Union(cell, VRange).Address = VRange.Address Then            Msgbox "The changed cell is in the input range."         End if     Next cell End Sub