How to tab from Cells to Buttons on Protected Sheet

StillOurRefuge

New Member
Joined
Aug 22, 2015
Messages
3
I basically have a lookup form/sheet. You enter a ZIP Code in the designated cell then click a "go" button and it gives a bunch of info from the ZIP entered.

(Sidenote that may or may not matter: the entire sheet is Protected except for the 1 cell to enter a ZIP Code)

My issue is that after entering the ZIP Code, you must actually click on the "go" button, which means switching from keyboard to mouse every time, just to click a button.

I can't figure out how to enable tabbing from the cell to the button, back to cell, etc., so that you could enter a ZIP code in the cell, hit tab, hit enter - and get results from that.

Any help?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Excel has Events, which can trigger a macro when then happen.
When a cell's value is changed, the Change event fires.

To access this, put a change event in the code module for the sheet in question.
In the VBEditor, in the Project Explorer, double click on the icon for the sheet.
A sheet module will appear.
From the top left drop down, select Worksheet. Then from the right drop down, select Change

This should appear in the module
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
End Sub
Target is the range object of the cells that have been changed. NB Target can be more than one cell. (Copy Pasting is a common way for Target to be more than one Cell

If you put code like this into that procedure you can see how it works.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    MsgBox Target.Address & " has been changed"
End Sub

For your case, you could use code like this. (if your Zip cell is A1 and your button calls Button1_Click)
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Range("A1")) Is Nothing Then
        Call Button1_Click
    End If
End Sub
 
Upvote 0
This method did work to auto-fill my fields when changed, but I was actually just wanting it to move to the button, without actually running that code.

I have a field (cell), then a button, then field, then button, then field, then button.

I simply want to be able to press "tab" and move from field, to button, to next field, to button, etc.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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