Simulate double click for each cell in range

Milos

Board Regular
Joined
Aug 28, 2016
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am wanting to simulate double clicking in a selected range as I have an 'almost complete macro' that only seems to work when I have double clicked in the specific cells.

I have come up with this code but it does not seem to work compared to when i physically double click each cell. Can somebody please help me fix this up so that it will simulate a double click in the selected range?

Code:
Sub Double_Click_Selected_Cells()


Dim rng As Range, cell As Range
   Set rng = Selection
   For Each cell In rng
        ActiveSheet.Activate
        Application.DoubleClick
   Next cell


End Sub

Cheers,
Milos
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Do you have a double click event?
You can put your macro "'almost complete macro'"
You must execute your "'almost complete macro'" by sending as a parameter each of the cells of the selection, not necessarily by double clicking on the cell.
 
Upvote 0
Yes I was playing around with a double click event also but I have removed it now as I no longer need it. I was trying to cheat by going for the lazy option rather than thinking for a while and actually fixing my macro. Turns out simulating a double-click is rather difficult from the (lack of) threads on the internet.

But I spent a day thinking and researching to turn my "almost complete macro" into a "complete macro" so I am all sorted, no double click required.

Cheers DanteAmor,
 
Upvote 0
I'm glad now you have your complete macro
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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