LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Insert row after blank cell encountered

I have a large table with infrequent blank cells in a single column. I want
to located these and insert a new row directly after that blank cell's row.
This isn't working ....

Sub InsertBlankLine()
'
FinalRow = Cells(Rows.Count, 8).End(xlUp).Row
'
For Counter = 1 To FinalRow
Set curCell = Worksheets("Sheet1").Cells(Counter, 6)
If curCell.Value < 1 Then curCell.Value = FinalRow
'
ActiveCell.Offset(1).EntireRow.Insert Shift:=xlDown
'
Next Counter
End Sub


Row 8 contains the first blank cell condition but the macro inserts 13 blank
rows right after the first row. (13 is the value of FinalRow).

I have spent 4 hours on this trying every combination I can think of. Your
help is appreciated.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Up until Non-Blank Cell encountered Jim May Excel Discussion (Misc queries) 6 November 28th 07 02:02 PM
if cell is blank insert a zero JK Excel Discussion (Misc queries) 3 October 24th 07 03:09 PM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
when encountered Zero/Blank CF issues ... Raj Excel Programming 6 September 14th 06 09:31 PM
Copy value and fill blank spaces below it until new value is encountered? drod[_2_] Excel Programming 4 January 8th 04 08:22 PM


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"