Thread
:
Make code apply to more than 1 column
View Single Post
#
2
Posted to microsoft.public.excel.misc
Don Guillett[_2_]
external usenet poster
Posts: 1,522
Make code apply to more than 1 column
Are you SURE you want this with a SELECTION change? Maybe a double click
instead.
or target.column = 12
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Cheryl" wrote in message
...
I am using this code to insert X in a column with a mouse click. I need
this
to apply to other column as well. How do I change this code?
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
If Target.Column = 5 Then
If Len(Trim(Target.Value)) = 0 Then
Target.Value = "X"
Else
Target.ClearContents
End If
End If
End Sub
Reply With Quote
Don Guillett[_2_]
View Public Profile
Find all posts by Don Guillett[_2_]