I am trying to copy a row in a table that includes some hidden date. I want to be able to past the row below creating another row in the table. When the columns are hidden I want them to also be copied and pasted below.
How can I make sure that all my data in that row is copied including the hidden date and pasted below.
This is my code:
How can I make sure that all my data in that row is copied including the hidden date and pasted below.
This is my code:
Code:
Private Sub CommandButton1_Click()
Dim myRow As Long, tblRow As ListRow
myRow = Cells(Rows.Count, "A").End(xlUp).Row
Set tblRow = Sheets("NSW Main Data").ListObjects("Table5").ListRows.Add(myRow - 2)
tblRow.Range.Offset(-1).Copy
tblRow.Range.PasteSpecial xlPasteAllMergingConditionalFormats
Application.CutCopyMode = False
With Range("A" & myRow)
.Value = "NSWM" & Right(Range("A" & myRow).Value, 6) + 1
.HorizontalAlignment = xlCenter
End With
End Sub