PDA

View Full Version : How to Create/Insert Empty Rows With Cell OnChange Method



revi2008
04-01-2009, 06:18 PM
I Have Trouble How To Make VBA Script For Automatic Insert Empty Cell When We Use Cell OnChange Method.... Please any one can help me.....

Demosthine
04-09-2009, 09:45 AM
Good morning.

In general, the more information you can provide the better. And if at all possible, please provide an example Workbook. This allows us to identify your problem and give you a clear solution.

However, I have provided a brief snippet that may give you an answer. You must include EnableEvents because the Change Event will execute a second time after the Row is inserted.



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value <> "" Then
Application.EnableEvents = False
Target.EntireRow.Insert xlDown, False
Application.EnableEvents = True
End If
End Sub


Let us know if this doesn't work for you.
Scott