Thread: indirect macro
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default indirect macro

probably word wrap, because it works fine.

Sub test()
For Each cell In Selection
cell.Formula = "=INDIRECT(" & Right(cell.Formula, Len(cell.Formula) - 1)
& _
")"
Next cell
End Sub

--


Gary


"ladyhawk" wrote in message
...
I am getting a syntax error when I attempted to run this macro...any ideas?

"Bob Phillips" wrote:

For Each cell In selection
cell.Formula = "=INDIRECT(" & right(cell.formula,Len(cell.Formula)-1)
&
")"
Next cell

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ladyhawk" wrote in message
...
Is there a way to change cells that currently read
='week 1'!$a$17
to read
=indirect("'week1'!$A$17")
I have a few thousand cells to change each one referncing a different
cell...for instance Cell A18, Cell A19 etc...