Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Autoadding new row

You're welcome nordscan.
Thanks for the feedback.
Ken Johnson

Reply
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



All times are GMT +1. The time now is 06:41 PM.

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

About Us

"It's about Microsoft Excel"