BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8

Hi,
Is it possible to output an excel file with the data formatted as a table (ctrl+t)?
If so, how can this be done?
Thank you.

4 REPLIES 4
gzr2mz39
Quartz | Level 8

What I'm trying to accomplish is exporting to excel and have the data automatically formatted as a Table.

So, instead of exporting the data, opening it in excel, and then formatting it as a Table (which can be accomplished by highlighting the data and pressing ctrl+t), I would like the table to be already formatted as a Table when it's exported by SAS.

ballardw
Super User

Once again for the Excel-centric: How and what are you currently moving the SAS results to Excel? If using proc export to send a dataset likely there is no solution as that procedure is intended for data interchange files and contains no formatting information at all on purpose.

 

Procedure output may be another matter.

 

Have you tried using ODS EXCELXP ? That creates xml that Excel can read and I would expect it bring it results as tablish of sorts.

 

Be aware that Excel will reformat things and you may have to spend time forcing values with leading zeroes to appear correctly.

Kurt_Bremser
Super User

Using ods tagsets.excelxp or ods excel (if you run SAS 9.4) allows you to create formatted spreadsheets.

But be aware that it will take more work than just hitting ctrl-t.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 4 replies
  • 879 views
  • 0 likes
  • 3 in conversation