PC Review


Reply
Thread Tools Rate Thread

Autofill incrementally within formulae

 
 
BarryMart
Guest
Posts: n/a
 
      14th Jul 2008
I have a formula in A536 that reads:
='536'!$D$7

I want the formula in A537 to read:
='537'!$D$7

and so on...

Any ideas welcomed and appreciated!

Thanks,
Barry


 
Reply With Quote
 
 
 
 
Charlie
Guest
Posts: n/a
 
      14th Jul 2008
I don't know if it can be done with drag-n-drop editing but you can do it in
VBA like this

Sub Test()

Dim Cell As Range

For Each Cell In Range("A536:A540")
Cell.Formula = "='" & Cell.Row & "'!$D$7"
Next Cell

End Sub

(You didn't say how far down you wanted to go so I just went to row 540 as
an example. I presume the workbooks 536.xls, 537.xls, etc., already exist,
otherwise you'll get the file dialog for every row when you run the macro.)


"BarryMart" wrote:

> I have a formula in A536 that reads:
> ='536'!$D$7
>
> I want the formula in A537 to read:
> ='537'!$D$7
>
> and so on...
>
> Any ideas welcomed and appreciated!
>
> Thanks,
> Barry
>
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      14th Jul 2008
=INDIRECT(ROW(536:536) & "!$D$7") entered in A536 then copied down.


Gord Dibben MS Excel MVP


On Mon, 14 Jul 2008 12:56:07 -0700, BarryMart
<(E-Mail Removed)> wrote:

>I have a formula in A536 that reads:
>='536'!$D$7
>
>I want the formula in A537 to read:
>='537'!$D$7
>
>and so on...
>
>Any ideas welcomed and appreciated!
>
>Thanks,
>Barry
>


 
Reply With Quote
 
BarryMart
Guest
Posts: n/a
 
      15th Jul 2008
That gives me an idea I will try, but it doesn't really work. I need the
formula to refer to a worksheet specifically named after the row in which the
formulae are to appear (i.e. ='536'!$d$7, ='537'!$d$7, ='538'!$d$7, etc)

But it has to be a formula so that the cells' data on that particular
worksheet dislays and is then calculated in the "collection" worksheet.

I hope that's clear, and please accept my gratitude for your suggestion!

Barry

"Gord Dibben" wrote:

> =INDIRECT(ROW(536:536) & "!$D$7") entered in A536 then copied down.
>
>
> Gord Dibben MS Excel MVP
>
>
> On Mon, 14 Jul 2008 12:56:07 -0700, BarryMart
> <(E-Mail Removed)> wrote:
>
> >I have a formula in A536 that reads:
> >='536'!$D$7
> >
> >I want the formula in A537 to read:
> >='537'!$D$7
> >
> >and so on...
> >
> >Any ideas welcomed and appreciated!
> >
> >Thanks,
> >Barry
> >

>
>

 
Reply With Quote
 
BarryMart
Guest
Posts: n/a
 
      15th Jul 2008
I may have missed something in your reply, but I think I tried a similar
approach in the following folder that only returned the data (that is, text0
not the real formula I need:

="="&"'"&ROW()&"'!$d$7"

That doesn't work because I need the formula to refer to a worksheet
specifically named after the row in which the formulae are to appear (i.e.
='536'!$d$7, ='537'!$d$7, ='538'!$d$7, etc)

But it has to be a formula so that the cells' data on that particular
worksheet dislays and is then calculated in the "collection" worksheet.

I hope that's clear, and please accept my gratitude for your suggestion!

Barry

"Charlie" wrote:

> I don't know if it can be done with drag-n-drop editing but you can do it in
> VBA like this
>
> Sub Test()
>
> Dim Cell As Range
>
> For Each Cell In Range("A536:A540")
> Cell.Formula = "='" & Cell.Row & "'!$D$7"
> Next Cell
>
> End Sub
>
> (You didn't say how far down you wanted to go so I just went to row 540 as
> an example. I presume the workbooks 536.xls, 537.xls, etc., already exist,
> otherwise you'll get the file dialog for every row when you run the macro.)
>
>
> "BarryMart" wrote:
>
> > I have a formula in A536 that reads:
> > ='536'!$D$7
> >
> > I want the formula in A537 to read:
> > ='537'!$D$7
> >
> > and so on...
> >
> > Any ideas welcomed and appreciated!
> >
> > Thanks,
> > Barry
> >
> >

 
Reply With Quote
 
BarryMart
Guest
Posts: n/a
 
      15th Jul 2008
Charlie,

FANTASTIC!

Sorry about the earlier hasty reply. I reentered the suggested code as a
MACRO and it worked perfectly!

Thanks so much for your help!

Barry

"Charlie" wrote:

> I don't know if it can be done with drag-n-drop editing but you can do it in
> VBA like this
>
> Sub Test()
>
> Dim Cell As Range
>
> For Each Cell In Range("A536:A540")
> Cell.Formula = "='" & Cell.Row & "'!$D$7"
> Next Cell
>
> End Sub
>
> (You didn't say how far down you wanted to go so I just went to row 540 as
> an example. I presume the workbooks 536.xls, 537.xls, etc., already exist,
> otherwise you'll get the file dialog for every row when you run the macro.)
>
>
> "BarryMart" wrote:
>
> > I have a formula in A536 that reads:
> > ='536'!$D$7
> >
> > I want the formula in A537 to read:
> > ='537'!$D$7
> >
> > and so on...
> >
> > Any ideas welcomed and appreciated!
> >
> > Thanks,
> > Barry
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incrementally Number Jeff C Microsoft Access Queries 2 30th Jul 2008 09:18 AM
Formulae: Paste value formulae after doing an average operation Lim Microsoft Excel Misc 4 20th Apr 2008 07:31 PM
Searching TEXT in formulae, rather than results of formulae =?Utf-8?B?QW5keUU=?= Microsoft Excel Worksheet Functions 1 15th Jul 2005 10:57 AM
Autofill Formulae =?Utf-8?B?c3lzdGVtX2Q=?= Microsoft Excel Misc 5 9th Mar 2005 09:55 AM
List incrementally? =?Utf-8?B?TWFyayBKYWNrc29u?= Microsoft Excel Worksheet Functions 3 14th Jan 2005 07:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 AM.