I call two small subroutines as part of a larger macro. They work perfectly in Windows (tested in Excel 2010 and 2013) but cause error messages on Macs (in Office 2011). I have very limited access to Macs - I had to use a computer in another department to debug the code - so I would appreciate any insight into the causes of the problems and how to fix them.
The first macro is meant to convert any existing table to a range, the second formats a range as a table with a specified name.
Any help will be greatly appreciated!
Cheers,
Lisa
The first macro is meant to convert any existing table to a range, the second formats a range as a table with a specified name.
Code:
Sub UnlistListObjects()
Do While ActiveSheet.ListObjects.Count > 0
ActiveSheet.ListObjects(1).unlist
Loop
End Sub
Sub formatAsTable_Vacancies()
Dim tbl As ListObject
Dim rng As Range
Set rng = Range(Range("A2"), Range("a65536").End(xlUp).Offset(0, 11))
Set tbl = ActiveSheet.ListObjects.Add(xlSrcRange, rng, , xlYes)
tbl.TableStyle = "TableStyleLight9"
tbl.Name = "VacanciesTable"
End Sub
Any help will be greatly appreciated!
Cheers,
Lisa