Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Relative addressing with INDIRECT function

Hi group,

Suppose I want to copy this formula:

=A1*INDIRECT("Sheet2!a1")

To the next cell down, such that the new cell get's the formula:

=A2*INDIRECT("Sheet2!a2")

If I use the ordinary copy command, the new cell gets the formula:

=A2*INDIRECT("Sheet2!a1")

which is not what I want.

I know there is a way to do this, because I've done it before--but it
was a while back.

Can someone please refresh my memory?

Thanks in advance.

--
John Uebersax

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Relative addressing with INDIRECT function

Assuming that sheet2!a1 contains the cell reference, then the formula
is wrong - it should be

=A1*INDIRECT(Sheet2!a1)

which will then copy correctly (it's the quotes that cause the
problem!)

if it's sheet2!a1 you actually want to refer to then you don't need the
indirect at all.

john wrote:
Hi group,

Suppose I want to copy this formula:

=A1*INDIRECT("Sheet2!a1")

To the next cell down, such that the new cell get's the formula:

=A2*INDIRECT("Sheet2!a2")

If I use the ordinary copy command, the new cell gets the formula:

=A2*INDIRECT("Sheet2!a1")

which is not what I want.

I know there is a way to do this, because I've done it before--but it
was a while back.

Can someone please refresh my memory?

Thanks in advance.

--
John Uebersax


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Relative addressing with INDIRECT function

=A1*Indirect("Sheet2!a" & row(A1))

would be one way. This wouldn't be affected by changes on Sheet2, but could
be affected by changes on the sheet with the formula.

--
Regards,
Tom Ogilvy


"john" wrote:

wrote:
Assuming that sheet2!a1 contains the cell reference, then the formula
is wrong - it should be

=A1*INDIRECT(Sheet2!a1)


No, I meant the question exactly as I asked it.

sheet2!a1 contains a value, not a formula or cell reference. The
purpose of the INDIRECT function here is to let me rearrange cells in
sheet2 without affecting formulas in sheet1.

In any case, removing the quotes doesn't work.

--
John Uebersax




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Relative addressing with INDIRECT function

Thanks Bob and Tom.

This seems to work for copying cells within the same column (which I
recognize was how I posed the question).

But what about also copying the formula

=A1*INDIRECT("Sheet2!a1")

to the next column, or to a 10x10 block of cells?

--
John

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Relative addressing with INDIRECT function

=a1*INDIRECT("Sheet2!"&ADDRESS(ROW(A1),COLUMN(A1)) )

--
Regards,
Tom Ogilvy


"John Uebersax" wrote:

Thanks Bob and Tom.

This seems to work for copying cells within the same column (which I
recognize was how I posed the question).

But what about also copying the formula

=A1*INDIRECT("Sheet2!a1")

to the next column, or to a 10x10 block of cells?

--
John


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Relative addressing with INDIRECT function

This appears to work. Thank you.

John

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative Addressing not working PocketRocket Excel Worksheet Functions 4 October 22nd 09 07:10 PM
Indirect function €“ relative column copy/paste Gary T Excel Worksheet Functions 1 September 24th 08 02:52 PM
Relative addressing DOGMA-DOT Excel Worksheet Functions 1 July 13th 06 10:45 AM
Relative Addressing Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 4 February 20th 05 04:43 AM
Indirect function - relative reference Vladimir[_2_] Excel Programming 3 February 5th 04 09:05 PM


All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"