+ Reply to Thread
Results 1 to 7 of 7

Dragging formulas that refer across sheets

  1. #1
    Registered User
    Join Date
    11-22-2009
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2003
    Posts
    10

    Dragging formulas that refer across sheets

    Hi Everyone,

    First off I want to say thank you for reading this and this looks like a great site.

    I have attached a dummy sheet for aid. On "Sheet" 1 cell C4, I would like it to refer to D1 on another sheet called "Jan 2003". Doing this is simply ='Jan 2003'!D1 . But I want to drag the formula across so it refers to the other worksheets. For instance, cell C5 would have 'Feb 2003'!D1 information, and C6 will have 'March 2003'!D1 . I am taking this all the way out to 2008. Any help is appreciated. Thanks!

    Dan
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-22-2009
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Help! Dragging formulas that refers across other sheets!

    I would also like to add that the names of the sheets may very within the years, for instance Jan 2003 then Jan. 2004 and January 2005. However, the data I want to pull run through the same "cell name" on consecutive sheets. I'm not skipping sheets here.

    Lastly, If the formula changes significantly if the sheets are all on a different work book. Please let me know.

    Thank you so much!

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Help! Dragging formulas that refers across other sheets!

    This is easier if C2:=Jan because then you can use indirect
    Please Login or Register  to view this content.
    It would aslo help if you would be consistent in Month naming.

    Jan, Feb, Mar, Apr, May, etc with 3 letters.
    Attached Files Attached Files
    Last edited by rwgrietveld; 11-22-2009 at 06:30 AM. Reason: added attachement
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  4. #4
    Registered User
    Join Date
    11-22-2009
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Help! Dragging formulas that refers across other sheets!

    amazing, thanks tons rwgrietveld. but I've been given a spreadsheet with inconsistent naming. Nothing absurd, first three letters seem always consistent. how would one cope with this. I've attached an example.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Dragging formulas that refers across other sheets!

    My previous attachement had a macro in it. Please run it and all sheet names will be listed in Sheet1.

  6. #6
    Registered User
    Join Date
    11-22-2009
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Dragging formulas that refer across sheets

    got it thanks. If I'm given a workbook with tons of sheets that even has the year changing such as January 2005, and January 06 and Jan07 what would you change in your macro below?

    Sub makeMonth()

    For x = 1 To Worksheets.Count
    If Worksheets(x).Name <> "Sheet1" Then
    Worksheets("Sheet1").Cells(1, 1 + x).Value = Right(Worksheets(x).Name, 4)
    Worksheets("Sheet1").Cells(2, 1 + x).Value = Left(Worksheets(x).Name, Len(Worksheets(x).Name) - 5)
    End If
    Next x
    End Sub

    This is great stuff. Really appreciate it.

  7. #7
    Registered User
    Join Date
    11-23-2009
    Location
    Belgie
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Dragging formulas that refer across sheets

    Hi,

    nice post!

    Does the same works when you use =indirect() when you want to refer across files? I tried but every time i reopen the file i get an "reference" error. When i reopen the files where the cels ar in, the reference error disappears.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1