'Copy table from one workbook to another however does not copy columns with equations properly

I have written code in VBA which copies a dynamic table (dynamic because it could be 20 rows or 200 etc) from one worksheet into another.

The issue I am having is that it’s not copying the table property. Ie particular columns that were populated by certain equations give different answers or are just blank.

Does anyone have any suggestion to the code?

Thanks so much!

''Sub Update_Slicer_Result()

'

' Dim wsData2 As Worksheet

' Dim tb2213b As Range

''

'

''

'' Define the workbooks to export

' Set wsData2 = Workbooks("tool").Worksheets("Copy of master table")

' Set wsFilteredData2 = Workbooks("Phase").Worksheets("Testimportdatatable")

'

''

''

'' 'Set

' Set tb2213b = wsData2.Range("Table2213")

' Set tb5 = wsFilteredData2.Range("Table5")

''

'' 'Clear 2nd table

' wsFilteredData2.Rows("3:100000").Delete shift:=xlUp

' wsFilteredData2.Range("A3:AX3").ClearContents

''



'

''Hide the rows

' Dim c As Range

' Dim inputRange As Range

' Set sheet = Application.ActiveSheet

' sheet.Rows.Hidden = False

'

' Dim lngMaxRow As Long

' lngMaxRow = Range("AX" & Rows.Count).End(xlUp).Row

' Set inputRange = Range("AX3:AX3" & lngMaxRow)

'

' For Each c In inputRange

' If c.Value = "0" Then

' c.EntireRow.Hidden = True

' End If

' Next c

'

'' 'Copy data

' tb2213b.SpecialCells(xlCellTypeVisible).Copy

' wsFilteredData2.Range("A3").PasteSpecial xlPasteValues

' Application.CutCopyMode = False

'



'

' 'Sheets("Copy of master table").Select

' Workbooks("Scenariotool_userinputs").Worksheets("Copy of master table").Select

' Cells.Select

' Selection.EntireRow.Hidden = False

''

'

'

'

' Application.EnableEvents = True

'

' Application.Calculation = xlCalculationAutomatic

'

'

'End Sub


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source