Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2021, 08:07 AM
yacov yacov is offline insert an empty row Windows 10 insert an empty row Office 2016
Competent Performer
insert an empty row
 
Join Date: Oct 2019
Posts: 139
yacov is on a distinguished road
Default insert an empty row

Hi


How to insert an empty row every 100 rows? The file contains 24000 rows in two columns.

thanks.
Yacov
Reply With Quote
  #2  
Old 08-10-2021, 10:03 AM
Logit Logit is offline insert an empty row Windows 10 insert an empty row Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

This code uses Col A as a means to track where to insert a blank row.

Code:
Option Explicit

Sub InsertBlankRows()
Dim lr As Long, r As Long

On Error Resume Next

Application.ScreenUpdating = False

    For r = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -100
        If Range("A" & r) <> "" And Range("A" & r - 100) <> "" Then Rows(r).Insert (1)
    Next r
    
Application.ScreenUpdating = True

End Sub
Reply With Quote
  #3  
Old 08-10-2021, 11:27 AM
yacov yacov is offline insert an empty row Windows 10 insert an empty row Office 2016
Competent Performer
insert an empty row
 
Join Date: Oct 2019
Posts: 139
yacov is on a distinguished road
Default

thanks. works great
Reply With Quote
  #4  
Old 08-10-2021, 01:26 PM
Logit Logit is offline insert an empty row Windows 10 insert an empty row Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

You are welcome.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a2 is not empty, color empty cells in b2:af2 turkanet Excel 2 08-20-2017 11:00 PM
insert an empty row Picture content control -> insert picture -> empty? Jaymond Flurrie Word 3 07-13-2016 07:00 AM
insert an empty row How do I insert pictures directly into picture boxes by clicking the box instead of using INSERT>PIC Bree Word 1 06-24-2016 10:32 PM
insert an empty row automatic insert hypens until the end of the row and in empty rows between paragraphs Ivica Word 3 12-28-2015 01:31 PM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft