I have a VBA code to add lines, it works well on my table, but im now trying to make a new code to get that data of an entire row, and paste it bellow the "original" row, my code so far
Sub INSERT_ROW_CC()
Application.ScreenUpdating = False
Application.CutCopyMode = False
Dim Table As Object
Dim Rows As Range
Set Rows = Worksheets("CC").Range("B18")
Dim Rng As Range
Set Rng = ActiveCell
Dim Data As String
Set Data = Rng.EntireRow
Set Table = ActiveSheet.ListObjects(1)
With Table
If Not Intersect(Selection, .DataBodyRange) Is Nothing Then
Rng.EntireRow.Offset(1).Resize(Rows.Value - 1).Value(Data).Insert Shift:=xlDown
End If
End With
Application.ScreenUpdating = True
Application.CutCopyMode = True
End Sub
The number of rows to be inserted is taken from behind another sheet, it is subtracted by 1 to compensate that I will always have 1 row that I want to duplicate. I'm not able to reference the "mother" row as the data or string to be pasted when the code inserts the additional rows. I'm using this code in a formatted table, so i dont wanna break my conditional formating, it doesn't have any formula in it, it's like a table of things to buy or do, all the data I enter manually or copy from other sources, pasting only values.
Set Rows = Worksheets("CC").Range("B18")
This will tell me how many lines I should have, the code I had created before this one worked perfectly without copying the contents of the line above where the other lines were added. If the number of rows is 1-1 i want to exit this sub, and will do something like a msgbox
Most of the times i will have a table filter at the moment i am adding the rows.
This table of mine is full of content, the fact that I want this code to work is what will make it easier for me to have another code that throw some contents to clipboard to work effectively, so I intend to merge them.
I'm stuck in this code at the moment, adding the lines was even easy, a content and pasting in the added lines is taking work.
Inserting Rows (Let's say the code is telling me that I have to have 5-1 rows)

Sorry the question was too long, I tried to add as much information as possible, thanks in advance!

