This is a discussion on VBA to convert a table to a range? within the Excel Questions forums, part of the Question Forums category; Hello all. I see that I can easily record the code to convert a range to a table, but nothing ...
Hello all. I see that I can easily record the code to convert a range to a table, but nothing is recorded when converting a table to a range. Any suggestions?
A Table in vba is a ListObject. You can just UniList it.
Notice, however, that you may also want to remove formattting. In that case store the ListObject Range before unlisting it. Ex.:
Code:Sub ConvertTableToRange() Dim rList As Range With Worksheets("Sheet3").ListObjects("Table1") Set rList = .Range .Unlist ' convert the table back to a range End With With rList .Interior.ColorIndex = xlColorIndexNone .Font.ColorIndex = xlColorIndexAutomatic .Borders.LineStyle = xlLineStyleNone End With End Sub
To understand recursion, you must understand recursion.