refedit errors when tabbing to another control

D

David Welch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top