ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Focus after combobox (https://www.excelbanter.com/excel-programming/341151-focus-after-combobox.html)

Ed

Focus after combobox
 
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.
--
Thanks - Ed

Dave Peterson

Focus after combobox
 
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.

Ed wrote:

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.
--
Thanks - Ed


--

Dave Peterson

Ed

Focus after combobox
 
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?
--
Thanks - Ed


"Dave Peterson" wrote:

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.

Ed wrote:

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.
--
Thanks - Ed


--

Dave Peterson


Dave Peterson

Focus after combobox
 
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).




Ed wrote:

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?
--
Thanks - Ed

"Dave Peterson" wrote:

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.

Ed wrote:

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.
--
Thanks - Ed


--

Dave Peterson


--

Dave Peterson

Ed

Focus after combobox
 
I got it.

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


"Ed" wrote:

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?
--
Thanks - Ed


"Dave Peterson" wrote:

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.

Ed wrote:

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.
--
Thanks - Ed


--

Dave Peterson



All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com