Macro to simulate a basic double click on a cell

winxpdows

New Member
Joined
Apr 21, 2011
Messages
24
When you are working in Excel and double click on a cell, it selects the cells and gives you a blinking cursor within the cell to enter values or a formula. I've written code to do various things, some of which are toggle double click events based on being in certain workbooks and have pretty much don't have that functionality anymore.

Besides canceling my double click sub routines, is there code that I can use to change the state of a cell when it's double clicked to mimic the way it normally is without any my code?

Any help is GREATLY appreciated.

Thanks in advance!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Welcome to the MrExcel board!

I must be mis-understanding because it seems you are saying that you have double-click event code but when you double-click a cell you don't want the double-click code to run. :confused:
 
Upvote 0
Yep. I have doubleclick code that does some formatting and adding data to cells. But in order to make it so that it only works on the workbooks that need it and not on other workbooks the user may be working on, I also have it so that the user toggles it on and off. when it is toggled on and the user switches to another workbook, they lose the basic double click to go into editing the cell. As a work around, I have it so that the first double click on another workbook toggles my doubleclick code off and then things work fine. But, ultimately, I would like the user to be able to keep the double click toggle on, move to other workbooks and still have their normally double click use.

I just need to know if there is a way to put a the activecell into that edit mode using VBA.

Thanks!
 
Upvote 0
Perhaps putting this line into your sub will have the desired effect:

SendKeys "{F2}"
 
Upvote 0
What am I missing here? Double-click code would normally be stored in the worksheet or workbook module of the sheet/book that it is to apply to. So if you have certain workbooks that you don't want it to apply to, just don't put the code in those workbooks.


I just need to know if there is a way to put a the activecell into that edit mode using VBA.
As a matter of interest, that was my very first question when I joined the forum. :biggrin:
http://www.mrexcel.com/forum/showthread.php?t=143560
 
Last edited:
Upvote 0
Thanks! That worked. I totally forgot about F2.

Peter_SSs... If I had seen your first post, that would have solved everything. =) I had searched terms like double click and couldn't find anything. The reason why the double click code isn't in the specific workbook is because I made it an add-in in case the user has multiple workbooks that need the new functionality.. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,690
Members
449,092
Latest member
snoom82

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top