Focus after combobox

E

Ed

I created combo boxes using it's properties, not vb programming, ie. using
the Control Toolbox and using the items properties. But how do I put the
focus back on the spreadsheet so I can tab to the next column? Right now I
am forced to click in the next column to regain focus on the sheet.
 
D

Dave Peterson

I double clicked on the combobox (while in design mode) and pasted this in:

Option Explicit
Private Sub ComboBox1_Change()
ActiveCell.Activate
End Sub

It seemed to work ok.
 
E

Ed

This kind of works. It brings the focus back to the sheet, but to the place
where I last had the cursor, which is not where I need it. If I have the
combobox on A5, can I bring the curosr back to A5?
 
D

Dave Peterson

Oops.

You could use something like:

Option Explicit
Private Sub ComboBox1_Change()
Me.ComboBox1.TopLeftCell.Offset(0, 5).Activate
End Sub

Do you really mean under the combobox? If yes, then drop that .offset(0,5).



This kind of works. It brings the focus back to the sheet, but to the place
where I last had the cursor, which is not where I need it. If I have the
combobox on A5, can I bring the curosr back to A5?
 
E

Ed

I got it.

Thanks so much for your help!
--
Thanks - Ed


Ed said:
This kind of works. It brings the focus back to the sheet, but to the place
where I last had the cursor, which is not where I need it. If I have the
combobox on A5, can I bring the curosr back to A5?
 

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