+ Reply to Thread
Results 1 to 6 of 6

insert blank rows based on columns a values numerically

  1. #1
    Registered User
    Join Date
    05-17-2009
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    insert blank rows based on columns a values numerically

    Hello , I work on university and take the colleges results to format it , I have the following

    before:

    column A........column B.......column C......column D
    3002................23................53.5.............29.5
    3005................33................58................30
    3007................32................48................30
    3010................35................36................30
    3011................20................38.5.............20.5
    3013................55................30...............47
    3014................16.5.............18.5.............28
    3016................33................45.5.............30

    column (a) represent seating number on what I arrange the rows on it in the work sheet , the missing numbers between (3002) and (3005) are absent students ,
    what I want is a macro to check column a , if the difference between for example 3002 and 3005 is 3 numbers then it insert 3 blank rows and write the missing seating number (3003,3004) in it , and if the difference for example only one number inserting one row and so on and mark the inserted value as red .

    after:

    column A........column B.......column C......column D

    3002................23................53.5.............29.5
    3003
    3004
    3005................33................58................30
    3006
    3007................32................48................30
    3008
    3009
    3010................35................36................30
    3011................20................38.5.............20.5
    3012
    3013................55................30...............47
    3014................16.5.............18.5.............28
    3015
    3016................33................45.5.............30

    I use office 2007

    Any help is appreciated , Thanx in advance .
    Last edited by elkhole; 05-17-2009 at 07:11 AM. Reason: forget office version

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: insert blank rows based on columns a values numerically

    No need for macro this is easily doable with functions and conditional formatting see attached
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    05-17-2009
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: insert blank rows based on columns a values numerically

    Thanx for reply , but I'm new in using excel and I didn't understand how did you do it , Can you explain it for me , please ?

    thanx for advance

  4. #4
    Registered User
    Join Date
    05-17-2009
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: insert blank rows based on columns a values numerically

    Please any help .

  5. #5
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    1,979

    Re: insert blank rows based on columns a values numerically

    I used Macro to solve it. You can see it as attached.

    Hope this helps,

    windknife
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-17-2009
    Location
    egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: insert blank rows based on columns a values numerically

    Thank you very very much it worked as a charm .

+ 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