View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Welch[_3_] David Welch[_3_] is offline
external usenet poster
 
Posts: 7
Default refedit errors when tabbing to another control

Hi,

I have a userform with three controls (refedit, checkbox and
commandbutton) setup with the tabindex property to go to
refedit-checkbox-commandbutton.

When I select a range in the current worksheet and press tab the
CheckBox1_Enter event fires fine. However, when I select a range in a
different worksheet and press tab the CheckBox1_Enter event doesn't fire.

Hmmm, does anyone have a solution to this problem (not using
inputboxes/old style DialogSheet refedits). I've always known there is
a problem with RefEdit events, but I did not think it disrupted events
of other controls on the form!!!

Here is code for the CheckBox1_Enter event:

Private Sub CheckBox1_Enter()
On Error GoTo Failed
Dim rng As Range
Set rng = Application.Range(RefEdit1.Text)
rng.Worksheet.Activate
rng.Cells(1, 1).Activate
Failed:
End Sub

---
Dave