View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
warrenshooter warrenshooter is offline
external usenet poster
 
Posts: 6
Default Tough one - Cell referencing in Excel/VBA

Hi Everyone,

Thanks very much for all the responses. Some great ideas but didn't solve
the problem.

I actually start with the case below and need to make a copy of the formula
into another sheet. It seems I need to 'decorate' the original references
with the activesheets name. So some code will create "=Average(A3:A4)" to
"=Average(Sheet!A3:A4).....it gets complicated when the original formula
becomes "=Average(A3,A4,A5:A6)" or something similar.

The results I want are the same as cut/paste without dependent formulas also
changing their references.

Cheers and thanks again for all the replies.



"warrenshooter" wrote:

I have two sheets (Sheet1 and Sheet2)

In cell A5 in Sheet1 I have a formula "=Average(A3,A4)"

I would like to copy this formula to cell A5 in Sheet2 but have the formula
still reference Sheet1. In cell A5 in Sheet2 the formula should be
"=Average(Sheet1!A3,Sheet1!A4)"

If Sheet1!A5 was originally "=Average(Sheet1!A3,Sheet1!A4)" then there is no
problem.

Would love to hear the answer. It must be something simple.

Warren