Change Single-Click Functionality?

G

Guest

Hi--

I work for a publishing company whose editors are really comfortable with
Microsoft Word. They're terrified of Excel and avoid it whenever possible.

I'm trying to sell the benfits of Excel to them, however, and am rebuilding
a few forms they've clunkily set as Word tables into Excel as a demo. By way
of trying to mimic Word as much as possible without sacrificing the benfits
of Excel, however, I was wondering if there's VBA code I can use to change
Excel's single-click function so that, whenever a user clicks on an unlocked
cell, an editing cursor immediately appears (as opposed to Excel's default,
where you need to double-click on a cell to to in-cell edits).

Most of the cells (espcially those with formulas) are locked, so that the
only unlocked ones are those calling for text input of one sort or another.
Is what I want to do even possible?

Thanks for any help anyone can offer!
 
C

Chip Pearson

It can be done, but to my mind shouldn't be done. Put the following in the
ThisWorkbook module.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
If Sh.ProtectContents = True Then
If Target.Locked = False Then
SendKeys "{F2}"
End If
Else
SendKeys "{F2}"
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
G

Guest

Thanks for the reply, Chip! I've referred to your Web site often over the
years, so it's a little like getting a reply from, say, Tom Cruise or
something.

Anyway, I agree it shouldn't be done. I like the protection that
double-click in-cell editing provides, but unfortunately I'm in the minority.
I'm afraid, though, that I don't think this method will work for me. Almost
everyone in Editorial is on PC, but a few of them are on Mac, and I don't
think SendKeys works on both platforms. (At least, that's what the help
system on a Mac told me this morning when I tested the procedure on it.)

So probably I'm just screwed on this poin,t unless you have any other ideas.
Sorry I didn't mention the PC/Mac thing in my email. Most of the time it
doesn't really effect how we use Word and Excel, but in this case it does.
Sigh.

I truly appreciate the suggestion, though!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top