Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Buttons that appear when double clicking in a cell | Excel Worksheet Functions | |||
Calling a value when double clicking a cell | Excel Programming | |||
Cell double-clicking problem | Excel Discussion (Misc queries) | |||
Double-Clicking a cell for Multiple Options | Excel Discussion (Misc queries) | |||
double clicking on a source cell | Excel Worksheet Functions |