Consulting

Results 1 to 2 of 2

Thread: How to Create/Insert Empty Rows With Cell OnChange Method

  1. #1

    How to Create/Insert Empty Rows With Cell OnChange Method

    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.....

  2. #2
    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.

    [VBA]

    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
    [/VBA]

    Let us know if this doesn't work for you.
    Scott
    You don't understand anything until you learn it more than one way. ~Marvin Minsky

    I never teach my pupils; I only attempt to provide the conditions in which they can learn. - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •