auto type text onclick in a cell

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
 
W

William

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

[email protected]

| 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
 
Top