+ Reply to Thread
Results 1 to 3 of 3

Macro to divide a range and insert them in new rows equally

  1. #1
    Registered User
    Join Date
    02-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Macro to divide a range and insert them in new rows equally

    Hi,

    I have set of datas as seen below.


    DATE OPEN HIGH LOW CLOSE
    13-Jan-14 1165 1200 1165 1185
    13-Jan-14 1165 1175 1165 1175
    13-Jan-14 1175 1185 1175 1185
    13-Jan-14 1185 1195 1185 1195
    13-Jan-14 1195 1200 1190 1190
    13-Jan-14 1190 1190 1185 1185

    The Second row starts with 13-jan-2014 is a OHLC values of a particular stock.Now i want to calculate the range(high-low) of the particular day.
    Then the range has to be divided into 10 per row.

    Here

    The second row has a range of (1200-1165)=35 points.Close is greater than open,So the stock has closed with up trend.
    so i have divided 35 by 10.The last row is left with 5 points short.It has to be considered with next day's data.And this process goes like a loop.It would be great if an expert can solve the issue.

    13-Jan-14 1165 1200 1165 1185 (Original row,Needs to be divided by 10)
    13-Jan-14 1165 1175 1165 1175
    13-Jan-14 1175 1185 1175 1185
    13-Jan-14 1185 1195 1185 1195
    13-Jan-14 1195 1200 1195 1195 (This is short of 5 points to reach 10,It has to be taken into account when next day opens)

    Regards,

    Netaji

  2. #2
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Macro to divide a range and insert them in new rows equally

    Can you attach a sample workbook with sample values with before result and after result sheets.

    thank you,
    venkat
    Give Feedback and Click(*)

  3. #3
    Registered User
    Join Date
    02-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Macro to divide a range and insert them in new rows equally

    Thanks for your reply Venkatpvc.I have attached the sheet for review.
    Attached Files Attached Files

+ 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. Help creating a macro that wil always insert a new row within a specific range of rows
    By billyshears in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2013, 02:23 PM
  2. [SOLVED] Macro to insert X rows depending on length of range
    By Whiskeytea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2012, 04:24 PM
  3. Divide cell amounts between cells equally
    By hotwoz in forum Excel General
    Replies: 6
    Last Post: 07-08-2011, 05:54 AM
  4. Macro to insert rows within a specified range
    By asha3010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2010, 03:45 AM
  5. Changing macro range when insert/delete rows
    By ioncila in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2009, 08:00 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