View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tami Tami is offline
external usenet poster
 
Posts: 123
Default Cell reference in VBA

i have a line of VBA code that asks if cell O1 is "000" then yada yada yada.
It looks like this:

If Cells(1, 15) = "000" Then

But if i insert a column somewhere to the left of column O, my code still
refers to cell O1 but needs to now refer to cell P1.

I've named the cell "data" and i tried
If Cells("data")="000" Then
but that didnt' work.
any other suggestions?