+ Reply to Thread
Results 1 to 6 of 6

Need MACRO help on inserting new rows when the value change.

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Kuala Lumpur,Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Need MACRO help on inserting new rows when the value change.

    Good Day everyone

    I need help on how to insert row when ever the list inside column change value. Example;

    Column A

    21341
    21341
    21341
    21288
    21288
    22344
    22344


    When the macro read 21288 it will insert new row above it. Then 22344 it will insert new row above it.

    that's how it is..

    Please guide me how to write the macro script.

    thank you

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need MACRO help on inserting new rows when the value change.

    hi wantaku11, assuming data starts from A1, try:
    Please Login or Register  to view this content.
    hope that helps & wishing you a merry Christmas eve~

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Need MACRO help on inserting new rows when the value change.

    Different method, no loop
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need MACRO help on inserting new rows when the value change.

    @ jindon,

    Very nice!

    I am trying to tweak your formula to cater for a header in Column A, but I cannot get the Formula right.

    It still shoes the header, but the Empty lines do not get inserted in the correct Row between the diffirent values.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Need MACRO help on inserting new rows when the value change.

    If header
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need MACRO help on inserting new rows when the value change.

    @ jindon,

    Very good, thank you!

    I must have hit a blank, because I could not spot this obvious approach.

    Maybe in future, I should just retire for a while when I am feeling so tired, as I did this morning.

    wantaku11 will surely like this improvement.

+ 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