+ Reply to Thread
Results 1 to 6 of 6

Offset from the precedent in formula in another Sheet

  1. #1
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Offset from the precedent in formula in another Sheet

    Numerical sheets refer to "base" sheet. I would like to have a formula or other vba which allows me to find a value in Base and return it in the numerical sheet.

    F2 in "1" = F2 in "base" - I need to insert K2 from "Base" into J2 in "1"
    F2 in "2" = F26 in "base" - I need to insert K26 from "Base" into J2 in "2"
    F2 in "3" = F51 in "base" - I need to insert K51 from "Base" into J2 in "3"

    And so on - the 25 row gap is constant.

    Any help would be appreciated

    steve


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Re: Offset from the precedent in formula in another Sheet

    I'm still struggling with this and have come up with the following as an alternative to my original post. Running only the first WITH statement works perfectly, but when I continue the procedure there are 2 problems. First, the second WITH (even if I manually select Sheet 2 first) runs its formula in sheet 1. Secondly it gives a #VALUE! result.

    As will be shown by my fumbling attempts, my expertise is not great. Any assistance with either lot of code would be very gratefully received.

    Steve

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Re: Offset from the precedent in formula in another Sheet

    Have played some more and by adding "Set RngColF = Range("f2", Range("f" & Rows.Count).End(xlUp))" after each sheet activation, it removes problem 1. Not pretty, but one step in the right direction.

    Steve

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Offset from the precedent in formula in another Sheet

    It would probably help if we could see what are working with? Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Re: Offset from the precedent in formula in another Sheet

    Thanks for your reply Ford. I've attached a file and altered my second lot of code as follows. Both efforts should produce the same result in the sample file Sheet 1, but I hadn't got to the IF statement with the first attempt, so it only looks at one column (if it worked), so sheet 2 would give a different result for the first lot of code.

    Appreciate any help you can provide. I need to go out for a few hours, so please don't think me rude if I don't respond to any further advice immediately.

    Steve

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    158

    Re: Offset from the precedent in formula in another Sheet

    Perseverance Pays! Finally have worked out some code that works. It looks cumbersome to me (there will be 10+ sheets) and if any body can show me a better way I'd be grateful.

    Will leave open for a day or so in hope, then mark Solved.

    Steve



    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Go to Precedent
    By plans in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 07:44 PM
  2. Help on Precedent cells
    By jatolo in forum Excel General
    Replies: 2
    Last Post: 03-26-2014, 07:57 PM
  3. Formula won't calculate properly when precedent is changed.
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2012, 11:12 PM
  4. Reformatting - insert formula with offset, then offset to next cell
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2011, 05:41 AM
  5. Formula Precedent changes isn't changing value
    By kevenmicheal in forum Excel General
    Replies: 5
    Last Post: 03-22-2011, 04:54 PM
  6. offset, multiple sheets, precedent data
    By ice1980 in forum Excel General
    Replies: 3
    Last Post: 04-03-2009, 12:51 PM
  7. [SOLVED] precedent
    By IcyMan in forum Excel General
    Replies: 3
    Last Post: 08-30-2005, 07:05 PM

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