Excel VBA convert all tables to ranges

jamilm

Well-known Member
Joined
Jul 21, 2011
Messages
740
Gurus,

is there a simple vba that converts all tables of workbook back to normal range?

thanks.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,150
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Give this macro a try...
Code:
Sub MakeAllTablesRegularRanges()
  Dim WS As Worksheet, LO As ListObject
  For Each WS In Worksheets
    For Each LO In WS.ListObjects
      LO.Unlist
    Next
  Next
End Sub
 
Upvote 0

BHorton2

New Member
Joined
Jul 6, 2017
Messages
1
Give this macro a try...
Code:
Sub MakeAllTablesRegularRanges()
  Dim WS As Worksheet, LO As ListObject
  For Each WS In Worksheets
    For Each LO In WS.ListObjects
      LO.Unlist
    Next
  Next
End Sub

No matter what I try to rename and save my file before running this macro, I get back a "Run-time Error '1004'"
 
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,150
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
No matter what I try to rename and save my file before running this macro, I get back a "Run-time Error '1004'"
Since this is a macro and you say you have not run it yet, then it cannot be the source of your "Run-time" error. Perhaps you have some code in the BeforeSave event procedure in the ThisWorkbook's code module (which would be running when you try to save the workbook) that is the source of this error.
 
Upvote 0

Forum statistics

Threads
1,191,385
Messages
5,986,314
Members
440,017
Latest member
vasanrajeswaran

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top