TabKey to CommandBox

GColeman

New Member
Joined
Feb 16, 2016
Messages
34
Office Version
  1. 2016
Platform
  1. Windows
I'm sure its in one of these threads somewhere, but I couldn't find a working answer. Here's what I got...

Active cell is G8. User will enter a name and press "Tab". Target Cell is A10. But I want it to automatically select a commandBox (Cmnd1) or open a userform (PRForm1) instead of selecting A10. I've tried a couple ideas listed here, but they have me using selectionchange and creating a macro. And I'm not sure how to activate that macro either with "Tab" from G8, or with target address.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "($A$10)" Then
PRForm1.Show
End If

End Sub
 
You can try something like this:
When the user double clicks on Range("G8") the UserForm named UserForm1 will show.

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("G8")) Is Nothing Then
Cancel = True
If Target.Cells.Count > 1 Then Exit Sub
UserForm1.Show
End If
End Sub
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top