Using absolute cell refernce and inserting rows
Ammended further..
Sub Indirect_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=INDIRECT(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=INDIRECT(""" & myStr & """)"
End If
End If
Next
End Sub
Gord
On Tue, 13 Dec 2005 14:50:51 -0800, Gord Dibben <gorddibbATshawDOTca@ wrote:
Lady
Ammended or use the one JE posted.
Sub Indirect_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=INDIRECT(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=INDIRECT(" & """" & myStr & """" & ")"
End If
End If
Next
End Sub
Gord
On Tue, 13 Dec 2005 13:42:33 -0800, "ladyhawk"
wrote:
OK I think I am getting closer but I think from this macro is missing two
extra " (quotes) one is after the =indirect(
the other is at the end before the last )
I appreciate everyones help!!
"Gord Dibben" wrote:
Lady
Maybe............
Sub Indirect_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=INDIRECT(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=INDIRECT(" & myStr & ")"
End If
End If
Next
End Sub
Gord Dibben Excel MVP
On Tue, 13 Dec 2005 08:16:02 -0800, "ladyhawk"
wrote:
Sorry for the confusion...first time using these boards....
What I am trying to do is to update my absolute cells in about 8 columns and
600 rows to include the instructions given to me in a reply to my earlier
post...the reply said to change the cell formula to be:
=INDIRECT("'week1'!$A$4")
but I will need to do this for cells A1 thru L600
I had read in a different post a quick macro to insert the $ making the
cells absolute and was looking for a similar one to insert the new
text(indirect(").
"JE McGimpsey" wrote:
What do you mean by "add this automatically for a group of cells"? Would
all of the cells have the same formula? In that case just select the
cells and use CTRL-Enter. If not, how should the formulae be constructed?
Note: It's definitely easier to figure out what you're referring to when
you add your follow-up to the reply, not the original question.
In article ,
"ladyhawk" wrote:
Great...that definatly did the trick!!
Now is there a macro to add this automatically for a group of cells?
"ladyhawk" wrote:
I am trying to use an absolute cell refernce on tab 2 that refernces tab 1.
When I insert a row on tab 1 (tab name is week 1)the refernce changes. For
example cell A4 the formula is ='week1'!$a$4
when I insert a row on the week 1 tab it changes tab 2 formula for cell A4
to
='week1'!$a$5
What can I do to make it not make that change but still be able to insert
rows?
|