keep cell reference

  • Thread starter Thread starter geebee
  • Start date Start date
G

geebee

hi,

i have a cell in sheet_new with a formula in cell A1:

= sheet1!C2

i would like to know how the cell A1 can keep this formula even if sheet1 is
deleted, because it may be possible to delete the sheet1 and later add it
back, so when it is added back, i want the formula remembered/restored.

thanks in advance,
geebee
 
This formula should work for you...
=IF(ISERROR(INDIRECT("Sheet1!A1")), "No Sheet1", INDIRECT("Sheet1!A1"))
 
basically just set up a macro that adds a sheet and then the formula
maybe give some more info as to what you're doing, if this doesn't help

Sub Add_Sheet()
Worksheets.Add after:=Worksheets(Worksheets.Count)
Range("A1").Formula = "=Sheet1!C2"
End Sub
 
Unless sheet1!a1 contains an error <vbg>:

=IF(ISERROR(CELL("Address",INDIRECT("'Sheet1'!A1"))),
"No Sheet1","yourformulahere")
 
it is not working. nothing is happening. i even tried =INDIRECT(TEST1!F20)
and i get a #REF! error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

hide sheet 4
Excel VBA 1
Extracting a Part of a Formula as Text 5
Excel Copy COUNTIF while retaining reference 7
add sheet values 5
VBA Countif across sheets? 5
Reference error in excel 6
Named Range maker code 9

Back
Top