View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default changing lists of cells to absolute values using a macro

Your macro probably says something like
cellFormulaR1C1 = R4C3

Which, of course, will always generate C4.

Instead of that, use this short macro to do what you want.

Sub AbsoluteReference()
'Modify range size in next line accordingly
For Each cell In Range("C4:C24")
cell.Formula = Application.ConvertFormula(cell.Formula, xlA1, xlA1,
xlAbsolute)
Next cell
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Allerum30" wrote:

I need to change several lists of cells from normal(ie. cell A1 shows the
value in cell C4) I need to change that value to $C$4. I do it by clicking
the cell and hitting F2 then F4. For a list of 20 cells. When I try to use a
macro to perform this function(using relative reference or not)all it does is
give me a list of 20 $C$4's. what am I doing wrong?