View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default VBA code based on column heading

Hi Gord,

Not sure why you offset to the next column, previous row when the OP
wants the value entered in the same row, next column.

I also don't understand why events are being disabled since the
executable code is wrapped in an IF construct.

In retrospect, I offer this revised approach for consideration:

Private Sub Worksheet_Change(ByVal Target As Range)
If Cells(1, Target.Column) = "Name" Then
If UCase$(Target.Value) = "TOOL ASSEMBLY" Then _
Target.Offset(, 1) = "A, B, C, D or whatever"
End If
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc