This Excel VBA macro converts a table into a normal range of cells.
Macro Example
Sub ConvertToRange() ActiveSheet.ListObjects(1).Unlist End Sub
Description
[Application.]ActiveSheet
ActiveSheet...
The [Application.]ActiveSheet property returns an active Worksheet or Chart object. So the Object Browser shows us that returned value is “Object”.
The ActiveSheet property is a member of the Excel.Global class, so we can omit the Application property.
ActiveSheet.ListObjects (Worksheet.ListObjects)
ActiveSheet.ListObjects...
The ActiveSheet.ListObjects (Worksheet.ListObjects property) returns a ListObjects collection object on the active worksheet.
ListObjects(1) (ListObjects._Default(1) )
ActiveSheet.ListObjects(1)...
The ListObjects._Default property returns a single ListObject object from a ListObjects collection object.
And the ListsObjects._Default(1) represents the first ListObject object.
The _Default property is a default member of the ListObjects collection object. We can see a little blue marble beside its icon in the Object Browser.
So we can omit the ._Default .
ListObjects(1).Unlist (ListObject.Unlist)
ActiveSheet.ListObjects(1).Unlist
The ListObjects(1).Unlist (ListObject.Unlist method) removes the list functionality from the ListObject object.
Sub ConvertToRange() ActiveSheet.ListObjects(1).Unlist End Sub
Properties
http://www.relief.jp/itnote/archives/excel-macro-convert-table-into-normal-range.php
Apply to
- Excel 2013
- Excel 2010
- Excel 2007