View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to reference column by name

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target,Range("F:F")) Is Nothing Then
....
End If
End Sub

or

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target,Range("columnF")) Is Nothing Then
....
End If
End Sub

where columnF is a range name

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Scott Steiner" wrote in message
. ..
Hi,

I want the following behaviour:

if the value of a cell changes, then I check if the column the cell is
in is a certain column, if yes then I do some calculation.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 Then
...
End If
End Sub

Question: How can I reference the queried column by name rather than by
number as above?

Thanks!