auto type text onclick in a cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to let Excel auto type a text string when I click in a
cell? I looking for a macro the type an "OK" when I click in cell R16C3,
cell R18C3 or in R16C7.

Regards,
Jonas
 
Hi

Try placing this code in the relevant worksheet module, NOT a general
module.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r As Range
If Target.Count > 1 Then Exit Sub
Set r = Sheets("Sheet1").Range("C16,C18,G16")
If Not Intersect(Target, r) Is Nothing Then Target = "OK"
End Sub


--
XL2002
Regards

William

(e-mail address removed)

| Is it possible to let Excel auto type a text string when I click in a
| cell? I looking for a macro the type an "OK" when I click in cell R16C3,
| cell R18C3 or in R16C7.
|
| Regards,
| Jonas
 

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

Back
Top