MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Active Cell Command

Posted by Mara on May 24, 2001 11:35 AM

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 ActiveCell = Range("D12:D22") Then
ActiveCell = UserForm1.ListBox1.Value
MsgBox "The Active Cell MUST be where you want the Text"

End If

NEEDLESS TO SAY... This didn't work.

Posted by mseyf on May 24, 2001 1:20 PM

you might try something like:

If Not Intersect(Range(ActiveCell, ActiveCell), Range("d12:d22")) Is Nothing Then