LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default Code and thanks for/to Tom and Frank

Hello again:

Thanks again guys but is not working:

So I have a big file; here are just few rows...

1 1 OK
2 2 OK
3 4 NO
2 2 OK
5 6 NO
******************

The code taht I would need is to search for no and when is
found to insert a row above

Thanks again and I am still testing those codes you gave
me but does not produce any result?

Sub InsertRowBeforeNo()
Dim rng as Range, i as Long
set rng = cells(rows.count,3).End(xlup)
for i = rng.row to 2 step -1
if Ucase(cells(rng.row,3).Value) = "NO" then
cells(rng.row,3).EntireRow.Insert
end if
Next
End Sub

Sub insert_rows()
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index+1, "C").Value ="No" Then
Cells(row_index + 1, "C").EntireRow.Insert
(xlShiftDown)
End If
Next
End Sub

Regards,

Dan



 
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
Frank Kobel Adam Excel Discussion (Misc queries) 3 December 29th 04 02:55 PM
Thank you so much, Frank Kabel and ~X! Kim-Anh Tran[_27_] Excel Programming 1 May 18th 04 11:17 PM
Message for Frank K Rich B[_3_] Excel Programming 4 May 16th 04 05:48 PM
Frank Kabel nrage21[_49_] Excel Programming 6 April 22nd 04 02:36 PM
Frank - Thanks Tim Excel Programming 0 February 12th 04 06:52 PM


All times are GMT +1. The time now is 03:41 AM.

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"