+ Reply to Thread
Results 1 to 15 of 15

Not skipping cell when dragging or copying

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Lightbulb Not skipping cell when dragging or copying

    Hello,


    I am new, but hope for your help with Excel 2010


    I am doing a sheet for analyzing projected financial plan, actual results and deviations. The problem is that I have a forecast for 40 years on a monthly basis and I can not do such sheets manually. I must to drag it.

    Let's start with one case.

    MAIN SHEET - Analysis of performance
    A = PLAN = "= PLAN_B! C2"
    B = RESULTS = "= RESULTS_B! C2
    C = Deviation from plan = A-C
    And so on in right for each another month.

    I want to drag this right three columns and they like to analyze each value from different sheet and calculate the deviation.

    So it Should be
    A2 = PLAN_B! C2 | B2 = RESULTS_B! C2 | C2 = A2-C2
    D2 = PLAN_B! D2 | E2 = RESULTS_B! D2 | F2 = D2-E2
    G2 = PLAN_B! E2 | H2 = RESULTS_B! E2 | I2 = G2-H2
    .... and so on.

    Unfortunately, when I drag it to the right in Excel, the values ​​in the linked sheets also jump at three positions which is
    A2 = PLAN_B! C2 | B2 = RESULTS_B! C2 | C2 = A2-C2
    D2 = PLAN_B! F2 | E2 = RESULTS_B! F2 | F2 = D2-E2
    G2 = PLAN_B! I2 | H2 = RESULTS_B! I2 | I2 = G2-H2

    Well, this is bad, because the source sheet which takes three columns ..



    Please help me.
    Attached Files Attached Files
    Last edited by radoslawz; 08-07-2013 at 02:17 PM. Reason: File added

  2. #2
    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,946

    Re: Not skipping cell when dragging or copying

    Hi and welcome to the forum

    I would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  3. #3
    Registered User
    Join Date
    08-07-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Not skipping cell when dragging or copying

    Hello. Thanks for your help and manual. Sample file was attached

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Not skipping cell when dragging or copying

    Select C7:E7. With the cursor grab the little square in the lower right corner of the selection by hovering over the square until the cursor becomes a cross then press and hold the left mouse button and drag to the right as far as you want. The 3 cell selection will be repeated as far as you drag. Now with the row still selected, grab the same "handle" and drag down.

    Would this result be what you want?
    I tried to upload the result but it was just too large.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    08-07-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Not skipping cell when dragging or copying

    Hi,


    Thanks but it is not working. After normal drag it skips 3 cells from source sheet.

    For Ex. there is =PLAN_B!F7 in dragged F7, but it should be =PLAN_B!D7

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Not skipping cell when dragging or copying

    Hi Radoslawz,

    You can fill them with this macro:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    And, you should be ready to go

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Not skipping cell when dragging or copying

    I don't know what you are doing differently, but it works perfectly here.

  8. #8
    Registered User
    Join Date
    08-07-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Not skipping cell when dragging or copying

    Hello.


    This Macro works very slowly so I'm waiting for the end. Maybe something is wrong with my Excel.

    Newdoverman: is it realy working perfectly? What do you have in F7 column after dragging? I have =PLAN_B!F7, not =PLAN_B!D7



    Maybe anybody could do it with INDEX() and COLUMNS() functions??

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Not skipping cell when dragging or copying

    Hi Radoslawz,

    I'll see if I can speed that up by using Worksheet Arrays!

    Edit:

    This takes about a second on your sample

    Please Login or Register  to view this content.
    Last edited by xladept; 08-07-2013 at 05:59 PM.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Not skipping cell when dragging or copying

    OK see what you mean. Totally misunderstood the problem.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Not skipping cell when dragging or copying

    The first macro only took a minute on your sample??? But, I speeded it up - so 40 seconds vs 40 minutes???

  12. #12
    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,946

    Re: Not skipping cell when dragging or copying

    Try this in C7...
    =INDEX(RESULTS_B!$C$7:$LN$132,ROW(A1),MATCH(C$5,RESULTS_B!$C$6:$LN$6,0))
    and this in D7
    =INDEX(PLAN_B!$C$7:$LN$132,ROW(A1),MATCH(Analysis!C$5,PLAN_B!$C$6:$LN$6,0))

    Copy both down, and then copy the pair over as far as you need to go

  13. #13
    Registered User
    Join Date
    08-07-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Not skipping cell when dragging or copying

    Quote Originally Posted by FDibbins View Post
    Try this in C7...
    =INDEX(RESULTS_B!$C$7:$LN$132,ROW(A1),MATCH(C$5,RESULTS_B!$C$6:$LN$6,0))
    and this in D7
    =INDEX(PLAN_B!$C$7:$LN$132,ROW(A1),MATCH(Analysis!C$5,PLAN_B!$C$6:$LN$6,0))

    Copy both down, and then copy the pair over as far as you need to go
    Hello.


    This formula works perfectly but only in first column - C. After dragging for ex. to F7 it shows #N/A error.

    But all seems to be fine. Any ideas?


    I will try macro, but it is harder to use it.

  14. #14
    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,946

    Re: Not skipping cell when dragging or copying

    Copy both down, and then copy the pair over as far as you need to go
    Perhaps you missed that part? copy, dont drag

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Not skipping cell when dragging or copying

    The macro can be triggered with a key or a button to ease its use

+ 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] Skipping a column when dragging formula
    By bharbir in forum Excel General
    Replies: 4
    Last Post: 08-05-2013, 01:51 AM
  2. Skipping 5 rows and then dragging formula down
    By Zack99 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-23-2013, 04:06 PM
  3. Skipping Every 5th Row and Dragging Down To Get New Data
    By seannydj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2012, 10:00 PM
  4. Dragging Formulas - Skipping Referenced Cells
    By markpratt in forum Excel General
    Replies: 2
    Last Post: 11-03-2011, 10:03 AM
  5. Replies: 4
    Last Post: 12-20-2005, 07:25 AM

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