View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Dave Peterson
 
Posts: n/a
Default Help with Newbie question - Cell Reference

You could name that cell (insert|name|define)

Then you could use:

myVar = worksheets("sheet1").range("mynamehere").value



wrote:

When writing a function in a cell, it always refers to that cell,
regardless if it moves. (Rows and columns are inserted) When writing
in VBA how do I make VBA track the cell's movement, so that when I
insert rows and columns with VBA code it is still referring to the
same cell?

Here is what I am using:

MyVAR = Cells(20, 6).Value 'If I insert rows and columns it still
refers to cell 20,6

Thanks in advance for any help with this!


--

Dave Peterson