Sub topic 13
Converting a Table Back to a Range
This chapter assumes you can create and name a table, use structured references, and add a total row. It covers how to turn a table back into a plain range, what you keep, what you lose, and how to do it with VBA.
Why convert back
A table is not always the right container. Common reasons to convert are:
- You need a feature that tables block, such as certain workbook sharing modes, or a cell merge inside the data.
- You want fixed A1-style formulas instead of structured references.
- The table was created by accident, for example by pressing Ctrl+T on the wrong block.
- You are handing the sheet to someone who needs a static layout.
What conversion keeps and what it removes
Conversion removes the table object but leaves your cells alone. The values stay. The formatting stays, including the table style's colors, which Excel turns into ordinary cell formatting.
Other table features change as follows.
| Table feature | After conversion |
|---|---|
| Data and formulas | Kept in the cells |
| Style colors and banding | Kept as normal cell formatting, but banding no longer follows sorting or new rows |
| Header filter buttons | Removed |
| Automatic expansion | Gone. New rows are not absorbed |
| Calculated column auto-fill | Gone |
| Slicers | Removed from the table |
| Table name | Removed from the workbook's names |
| Structured references | Rewritten as A1 references |
Convert with the Ribbon
- Click any cell inside the table.
- Open the Table Design tab (called Table Tools > Design in older versions).
- In the Tools group, choose Convert to Range.
- Confirm the prompt: "Do you want to convert the table to a normal range?"
You can also right-click a cell in the table and choose Table > Convert to Range.
What happens to formulas
Formulas elsewhere in the workbook that used structured references are rewritten to ordinary references. Suppose a cell held this formula:
=SUM(SalesTable[Amount])After conversion, if the Amount column occupied cells D2:D101, the formula becomes:
=SUM($D$2:$D$101)Formulas inside the former table are rewritten in the same way. A calculated column that read =[@Quantity]*[@[Unit Price]] becomes a reference such as =B2*C2 in each row. If the formulas were written with the table's own name, they become absolute ranges, so check them before you copy them elsewhere.
A total row stays in place as an ordinary row. Its SUBTOTAL formulas keep working, but they now refer to a fixed range and no longer grow.
=SUBTOTAL(109,$D$2:$D$101)Common errors
- Assuming undo is always available. Ctrl+Z reverses the conversion only until you run another action that clears the undo history, such as running a macro. Save a copy first if the table is complex.
- Expecting new rows to join. After conversion, typing under the last row does nothing special. Formulas will not extend and the old range will not grow.
- Leaving banded colors that no longer match. The stripes are now static. Sorting moves the colors with the data only if they were applied to the cells, so re-apply formatting after a sort.
- Forgetting dependent items. PivotTables, charts, and named formulas that pointed at the table now point at a fixed address. Check them after converting.
Convert with VBA
A table is a ListObject. The Unlist method converts it to a range and matches the Ribbon command. The following macro does it for the table named SalesTable.
Sub ConvertSalesTableToRange()
ActiveSheet.ListObjects("SalesTable").Unlist
End SubThis code assumes the table is on the active sheet. If no table has that name there, VBA raises run-time error 9 (subscript out of range).
The conversion flow
Exercise
A table named SalesTable occupies A1:D101, with Amount in column D. A cell outside the table holds =SUM(SalesTable[Amount]). You convert the table to a range, then type a new record in row 102. What does the outside formula return, and why?
Show answer
The formula was rewritten to =SUM($D$2:$D$101) during conversion. The new row in row 102 is not part of that fixed range, so the new amount is not included. The table no longer expands, so you must edit the range by hand or turn the data back into a table.
Exercise
Which VBA method converts a ListObject to a normal range, and what error appears if the table name is wrong?
Show answer
The Unlist method. A wrong table name raises run-time error 9, "Subscript out of range".