Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Insert blank rows based on cell value

  1. #11
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    replace

    Code:
    If Ofst > 0 Then
                    Ofst = IIf(Ofst = 1, 1, Ofst - 1)
                    .Cells(I + 1, 1).Resize(Ofst).EntireRow.Insert
                    .Cells(I, 2).Resize(Ofst + 1).Value = .Cells(I, 2).Value
                End If
    with

    Code:
    If Ofst > 1 Then
        .Cells(I + 1, 1).Resize(Ofst).EntireRow.Insert
        .Cells(I, 2).Resize(Ofst + 1).Value = .Cells(I, 2).Value
    End If
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  2. #12
    Member
    Join Date
    Sep 2013
    Posts
    37
    Rep Power
    0
    it's not fully work...for base upon 0 or 1, it's work but for base upon greater than equal 2 is still wrong

    should be :

    2-------title1----not inserted
    -------title1 ---inserted row
    4-------title2---not inserted
    -------title2---inserted row
    -------title2---inserted row
    etc...

    would you help me....
    thanks...admin

  3. #13
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    Code:
    If Ofst > 1 Then
        .Cells(I + 1, 1).Resize(Ofst - 1).EntireRow.Insert
        .Cells(I, 2).Resize(Ofst + 1).Value = .Cells(I, 2).Value
    End If
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  4. #14
    Member
    Join Date
    Sep 2013
    Posts
    37
    Rep Power
    0
    Quote Originally Posted by Admin View Post
    Hi

    Code:
    If Ofst > 1 Then
        .Cells(I + 1, 1).Resize(Ofst - 1).EntireRow.Insert
        .Cells(I, 2).Resize(Ofst + 1).Value = .Cells(I, 2).Value
    End If
    it's realy realy work 1000%....

    thank you for the help...admin

    you are the best......

Similar Threads

  1. Replies: 5
    Last Post: 07-11-2013, 07:31 AM
  2. Insert Picture in a Cell UDF
    By Admin in forum Download Center
    Replies: 10
    Last Post: 12-07-2012, 04:49 PM
  3. Autofill the data based on non blank cell in next row?
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 3
    Last Post: 11-29-2012, 04:16 PM
  4. Insert 'n' number Rows after any specified row no.
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 11-08-2011, 08:59 AM
  5. Deleting blank rows
    By Rasm in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 04-14-2011, 03:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •