Active Cell within a set range
Posted by Raishon on May 31, 2001 2:54 PM
I have a userform that when you click OK it populates the active cell with the value selected. Can someone help me with a code that if the active cell isn't within a certain range of cells than message box
I tried
If Intersect(Range("d10:d29"), ActiveCell) Then
MsgBox "The Active Cell MUST be where you want the Text"
Else
ActiveCell = UserForm1.ListBox1.Value
End If
This works if the active cell is within the range, if the active cell outside of the range I get an error "Object variable not set"