Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Double clicking a Cell Programatically

Is it possible to double click a cell "programatically"?

I would like to double click a ComboBox and have it "double click" the cell
that is set as the ComboBox's ControlSource which will then run a macro
residing in the worksheet.

Is this possible? Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Double clicking a Cell Programatically

You can sort of do it functionally. Double-clicking a cell (manually) puts
you in Edit mode. Any characters entered after this will be appended tto the
existing cell contents. It also Selects the cell you double-clicked on.
Lets say we want to do this to cell A1:


Sub pseudo_double_click()
Range("A1").Select
Application.SendKeys "{F2}"
DoEvents
End Sub


This will leave you exactly as if you had double-clicked A1
--
Gary''s Student - gsnu200716


"ToddG" wrote:

Is it possible to double click a cell "programatically"?

I would like to double click a ComboBox and have it "double click" the cell
that is set as the ComboBox's ControlSource which will then run a macro
residing in the worksheet.

Is this possible? Any help would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Double clicking a Cell Programatically

You can sort of do it functionally. Double-clicking a cell
(manually) puts you in Edit mode.


That only works for me if I have "Tools | Options | Edit | Edit directly in
cell" checked (which I don't usually have) and even then, the insertion
point appears in the cell's current contents relative to where you click in
the cell. To make it appear at the (right) end of the cell's current
contents you first have to make sure the cell's column is wide enough, and
then click far enough over to the right of the cell.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Double clicking a Cell Programatically

I guess that doesn't work for me either.

What I have is code residing in the Worksheet that inserts a cell comment
then displays an InputBox for entering the comment text when a cell is double
clicked. What i'd like this to do is the exact same thing when I double click
a ComboBox and have it insert the comment to the ComboBox's ControlSource
cell.


"IanKR" wrote:

You can sort of do it functionally. Double-clicking a cell
(manually) puts you in Edit mode.


That only works for me if I have "Tools | Options | Edit | Edit directly in
cell" checked (which I don't usually have) and even then, the insertion
point appears in the cell's current contents relative to where you click in
the cell. To make it appear at the (right) end of the cell's current
contents you first have to make sure the cell's column is wide enough, and
then click far enough over to the right of the cell.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Double clicking a Cell Programatically

You might try to use the Event code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

this goes in worksheet code and allows you to execute a macro when you
double-click. I just don't know what your code would do.
--
Gary''s Student - gsnu200716


"ToddG" wrote:

I guess that doesn't work for me either.

What I have is code residing in the Worksheet that inserts a cell comment
then displays an InputBox for entering the comment text when a cell is double
clicked. What i'd like this to do is the exact same thing when I double click
a ComboBox and have it insert the comment to the ComboBox's ControlSource
cell.


"IanKR" wrote:

You can sort of do it functionally. Double-clicking a cell
(manually) puts you in Edit mode.


That only works for me if I have "Tools | Options | Edit | Edit directly in
cell" checked (which I don't usually have) and even then, the insertion
point appears in the cell's current contents relative to where you click in
the cell. To make it appear at the (right) end of the cell's current
contents you first have to make sure the cell's column is wide enough, and
then click far enough over to the right of the cell.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Buttons that appear when double clicking in a cell Leopold Excel Worksheet Functions 1 April 25th 07 08:38 PM
Calling a value when double clicking a cell [email protected] Excel Programming 0 December 8th 06 04:56 PM
Cell double-clicking problem vbMark Excel Discussion (Misc queries) 4 August 30th 06 08:09 PM
Double-Clicking a cell for Multiple Options andym Excel Discussion (Misc queries) 1 February 24th 05 09:46 PM
double clicking on a source cell martin Excel Worksheet Functions 1 February 8th 05 02:09 AM


All times are GMT +1. The time now is 11:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"