Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub AdicionaLinha(ByVal strTableName As String, ByRef arrData As Variant)
- Dim tbl As ListObject
- Dim NewRow As ListRow
- ' Based on OP
- ' Set Tbl = Worksheets(4).ListObjects(strTableName)
- ' Or better, get list on any sheet in workbook
- Set tbl = Range(strTableName).ListObject
- Set NewRow = tbl.ListRows.Add(AlwaysInsert:=True)
- ' Handle Arrays and Ranges
- If TypeName(arrData) = "Range" Then
- NewRow.Range = arrData.Value
- Else
- NewRow.Range = arrData
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement