Jump to content

Format range as table in Excel


Recommended Posts

Just record a macro performing the tasks and then convert the vb as Nine suggested, for example:

#include <Excel.au3>

Global Const $xlSrcRange = 1
$oExcel = _Excel_Open()
$oWorkbook = _Excel_BookNew($oExcel)
$oWorkbook.ActiveSheet.ListObjects.Add($xlSrcRange, $oWorkbook.ActiveSheet.Range("$A$1:$H$3"),"",$xlYes).Name = "Table1"
$oRange = $oWorkbook.ActiveSheet.Range("Table1[#All]").Select
$oWorkbook.ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleLight3"

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...