Consulting

Results 1 to 4 of 4

Thread: Automatic row addition

  1. #1
    VBAX Regular
    Joined
    Jun 2014
    Posts
    51
    Location

    Automatic row addition

    Hello
    I have a little problem and do not know where to begin.
    I have a table with 4 columns and 15 rows and each time i need to copy to the table different number of rows.
    Each time i need to add manually additional rows.
    Is there a to add rows automatically based on the amount of rows in the table and the amount of rows that need to copied?

    Thank you

    Regards Oleg

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I am not fully understanding
    Each time i need to add manually additional rows.
    Why must you add more rows?

    Perhaps you can make a spreadsheet with three tables, one with 15 rows that looks like before copying to the table, one that looks like after copying to the table, and one that looks like after manually adding rows to the table. One more example = the Rows you copy to the table.

    Also show us the code you are using.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Jun 2014
    Posts
    51
    Location
    Hello and thank you for the replay.

    For the first question - i need more rows because each time i copy to the table different number of rows and after addition i deleting an empty rows.
    The code that i use:

    Private Sub Worksheet_Change(ByVal Target As Range)    r = Target.Row
        c = Target.Column
        If c <> 1 Then Exit Sub
        Application.EnableEvents = False
        NextLineValue = Cells(r + 2, c)
        If NextLineValue = "The signature indicates that all characteristics are accounted for; meet drawing requirements or are properly documented for disposition." Then
            Rows(r + 1).Insert
        End If
        Application.EnableEvents = True
         
    End Sub
    i prefer that this will be done automatically without "Enter"

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I think that we need to see the workbook.

    There is a method on the Go Advanced page here to attach files.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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