Set a flag in code when the button is clicked, reset the flag when
something else (another control, a worksheet cell, etc as appropriate)
is selected. Then, to know if the button has the focus, test the flag.
Hi and thanks for the reply. I have a combination of cells, command
buttons, and radio buttons that I am trying to set up a tab order using
Application.OnKey("{TAB}", "tabPress" to capture the tab key. For tabPress
I am using if then, elseif
structure to determine the active cell or button and where to move the
focus.
ex) if ActiveCell = Range("AccountNumber") then
Application.Goto Reference "Amount"
else if ActiveCell = Range("Amount") then
Sheet1.CashRB.Activate
else if Sheet1.CashRB 'this is where I need to determine if the
control has the focus so that I can move the focus to the next control
how this give you more idea as to what I am trying to do. If I had to do it
all over again I would make this sheet a form by itself.
thanks
bill
If ActiveCell = Range("AccountNumber") then
Application.Goto Reference "Amount"
else if ActiveCell = Range("Amount") then
Sheet1.CashRB.Activate
m_blnHasFocusCashRB = True
End if