Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autoadding new row
hi all. if is "no" in column "C" i need a new row. Sorry for my english. examp: Befo yes no yes yes no no After: yes no yes yes no no thnx al -- nordsca ----------------------------------------------------------------------- nordscan's Profile: http://www.excelforum.com/member.php...fo&userid=3113 View this thread: http://www.excelforum.com/showthread.php?threadid=50799 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autoadding new row
Hi nordscan,
Try this on a backup copy of your worksheet... Public Sub Insert_Row_If_C_no() Application.ScreenUpdating = False Dim iLastRow As Long iLastRow = ActiveSheet.Range("C" & Range("C:C"). _ Rows.Count).End(xlUp).Row Do While iLastRow 1 If Cells(iLastRow, 3).Value = "no" Then Cells(iLastRow, 3).EntireRow.Insert End If iLastRow = iLastRow - 1 Loop End Sub Ken Johnson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autoadding new row
Hi nordscan,
sorry, make that... Public Sub Insert_Row_If_C_no() Application.ScreenUpdating = False Dim iLastRow As Long iLastRow = ActiveSheet.Range("C" & Range("C:C"). _ Rows.Count).End(xlUp).Row Do While iLastRow 0 If Cells(iLastRow, 3).Value = "no" Then Cells(iLastRow, 3).EntireRow.Insert End If iLastRow = iLastRow - 1 Loop End Sub just changed the 1 to a 0 in 6th line Ken Johnson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autoadding new row
Coool nice work, very very thnx.. -- nordsca ----------------------------------------------------------------------- nordscan's Profile: http://www.excelforum.com/member.php...fo&userid=3113 View this thread: http://www.excelforum.com/showthread.php?threadid=50799 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autoadding new row
You're welcome nordscan.
Thanks for the feedback. Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|