If you mean a worksheet based "form" then getting a worksheet to recognize
the Mouse_Move event and to drag crosshairs is very technically challenging
and at the same time, from what I recollect, problematic. Instead, if
acceptable, I suggest adapting Bob Phillip's post from the following thread.
Note also Robert McCurdy's post:
http://tinyurl.com/m3gs7
I append my suggested adaption of Bob's post. Assumed is that the form area
is within the range "B2:Z30". For the demo, I advise making column widths and
row heights equal and giving the range an interior colour, say gray. Note
that the highlighting is not affected by selecting multiple cells within the
form area or selecting outside of the form area.
Paste to the worksheet code module:-
Const HLColor As Long = 13434879
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range, rcol As Range, rrow As Range
Set r = Me.Range("B2:Z30")
If Intersect(Target, r) Is Nothing Then Exit Sub
Set rcol = Intersect(r, Target.EntireColumn)
Set rrow = Intersect(r, Target.EntireRow)
With Target
If .Count > 1 Then Exit Sub
r.FormatConditions.Delete
With rrow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.Color = HLColor
End With
With rcol
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.Color = HLColor
End With
.FormatConditions.Delete
End With
End Sub
Regards,
Greg