+ Reply to Thread
Results 1 to 3 of 3

Insert rows in between a range from another range based on dates

  1. #1
    Registered User
    Join Date
    11-28-2016
    Location
    Sydney
    MS-Off Ver
    10
    Posts
    2

    Insert rows in between a range from another range based on dates

    Hello,
    I am new to this forum and trying to seek some help.
    I have an excel which has following data divided into 2 ranges Credit and Debit

    Worksheet 1

    DATE CREDIT DATE DEBIT
    25-11-16 300 29-11-16 -90
    09-12-16 300 13-12-16 -90
    23-12-16 125 27-12-16 -90
    06-01-17 125
    07-01-17 300

    In worksheet 2 I want this two ranges to be merged and output as

    Date Cumulative Points
    25-11-16 300
    29-11-16 210 -- Derived as (300-90)
    09-12-16 510
    13-12-16 420
    23-12-16 545
    27-12-16 455
    06-01-17 580
    07-01-17 880

    I am new to VBA and have tried to understand some codes I found, like -

    Please Login or Register  to view this content.
    But here it inserts a blank row whereas I am trying to insert from another range. Can anyone please help me with some idea and sample code.

    thanks,
    PS

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Insert rows in between a range from another range based on dates

    Hi,
    Your code should only insert blank row, so it`s working fine.
    In case you are not familiar with VBA you may try to copy Debit data under Credit data (make one range of data), then sort it by Date. You should get something like:
    25-11-16 300
    29-11-16 -90
    09-12-16 300
    ....

    Then in additional column to the right enter formula that will sum current row value with prev. row value (300 - 90), then (210+300) and so on. This should give you result you want.

  3. #3
    Registered User
    Join Date
    11-28-2016
    Location
    Sydney
    MS-Off Ver
    10
    Posts
    2

    Re: Insert rows in between a range from another range based on dates

    Thanks for the idea!! this should work for me , additionally I found this in the forum.

    http://www.excelforum.com/excel-prog...ge-values.html

+ 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. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  2. Replies: 1
    Last Post: 11-24-2015, 03:00 AM
  3. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  4. Hide rows in range 2 based on filter selection in range 1
    By gtol in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-28-2012, 02:09 PM
  5. Replies: 8
    Last Post: 02-27-2009, 06:06 PM
  6. [SOLVED] how can i insert a subtotal from a range of dates
    By rosa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2006, 02:00 PM
  7. [SOLVED] HOW CAN I INSERT A SUBTOTAL FROM A RANGE OF DATES
    By rosa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-24-2006, 12:55 PM

Tags for this Thread

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