Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double-Click on cell

Status
Not open for further replies.

edwardpestian

Technical User
Apr 28, 2006
47
US
Is there a way to only single click on a specific cell, but have the curser appear is if you had double clicked on it. I need this function for cells E6, E6, and G6 only.

Thanks in advance.

Regards,

ep
 
Actually guys, I'm on a Mac. I've been working on the project from home where I only have a Mac. When I get to work tonight, I'll test in on a Windows box and post an answer as to how things go. Strangely enough, all the other VBA code that I've worked with has worked fine.

Thanks again.

ep
 
EP,

I wouldn't be surprised that most native VBA commands work (notable exceptions or differences, as it relates to the MAC, are usually pointed out in the VBA Help). So, I'm still perplexed as to why the Select Case statement raised a compiler error. On the other hand, the Windows API functions are certainly OS-dependent.

Let us know what happens on your Windows box.


Regards,
Mike
 
Ah, the Mac. I'm sorry, I forgot about you being on a Mac Edward, my apologies.

Change out the standard module routine for the SendKeys method ...

Code:
Sub EditMode(rngEdit As Range)
    Application.SendKeys "{F2}"
End Sub

Works for me.

HTH

-----------
Regards,
Zack Barresse
 
Works perfectly on my Widows box. Can we take it one step further?

Only have the function happen when the cell has a blank value. Once the cell has data in it, it would simply function as normal.

Thanks all.

ep
 
Yeah. We could take it a step farther and get rid of the standard module altogether (since we can't do the API with Mac's)...

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    If Intersect(Target, Me.Range("E5,E6,G6")) Is Nothing Then Exit Sub
    If Target.Value <> "" Then Exit Sub
    Application.SendKeys "{F2}"
End Sub

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top