enter text in cell just by selecting cell
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
For Each cell In Target
cell.Value = "X"
Next cell
End If
ws_exit:
Application.EnableEvents = True
End Sub
This is sheet event code. Right-click on the sheet tab and "View Code"
Copy/paste into that sheet module. Alt + q to return your sheet.
Adjust the range A1:A10 and the value "X" to suit.
Gord Dibben MS Excel MVP
On Sat, 15 Dec 2007 10:10:01 -0800, dlyon
wrote:
When i select a cell i would like the letter X or a number to automatically
insert.
|