You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brendon edited this page Mar 17, 2024
·
1 revision
InsertDataTableToCell
returns Range (appears as Object to allow late binding)
accepts (rngOUT as Range, objTable as cDataTable, Optional blnExcludeHeader as Variant)
You can output your cDataTable to Excel easily by passing the top left cell of the Range where you want the data to be pasted, along with the cDataTable and optionally whether you want to exclude the header row or not.
If any type of error is encountered a general error handler exits the method and it returns Nothing
Example
Set ws = wb.Worksheets.Add
ws.Name = "DemoDataFactoryExcel"
Set d = DemoDataFactoryExcel
Set objrange = f.InsertDataTableToCell(Selection, d)
Set d = f.GetDataTableFromRange(objrange)
Set objrange = objrange.Offset(0, 10)
f.InsertDataTableToCell objrange, d