View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Taking focus off control on sheet

ps. maybe something like:

Option Explicit
Private Sub ComboBox1_Change()
ActiveCell.Activate
'your code here
End Sub

If you're using a control (like a commandbutton from the control toolbox
toolbar), you can change the .takefocusonclick property to false.

Dave Peterson wrote:

You should have included more details of what you wanted in your original post.

Don Wiss wrote:

On Thu, 03 Aug 2006, Dave Peterson wrote:

Don Wiss wrote:

In my code I have used various methods to get the focus off of a Control
Toolbox control, like a combo box or check box. One I use is:

SendKeys "{ESC}"

I don't think that this is the best. But I can't find in all of the code
I've written what the other methods I've used are.


activesheet.range("a1").select

(choose a cell of your choice?)


No. That is the worst way of doing it. You don't know where their cursor is
on the sheet and you want to put it back where it was. And you don't want
the sheet to move.

I had two more I used. One was something about an active window.

Don <www.donwiss.com (e-mail link at home page bottom).


--

Dave Peterson


--

Dave Peterson