PDA

View Full Version : Automatic row addition



olegvolf
12-23-2014, 03:00 AM
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

SamT
12-23-2014, 11:58 AM
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.

olegvolf
01-14-2015, 01:33 AM
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"

SamT
01-14-2015, 08:09 AM
I think that we need to see the workbook.

There is a method on the Go Advanced page here to attach files.