BookmarkSubscribeRSS Feed
EHittner
Fluorite | Level 6

I'd like to export a SAS query result to an existing Excel spreadsheet on a specific sheet tab.  I have a pre-formatted template in my spreadsheet on Sheet1, that is linked to a range of cells on Sheet2.  Sheet2 is where I want my data to be inserted.  Is there a way to do that without creating a new spreadsheet document each time?  Seems like it would be simple -- but I've spoken too soon before.  

2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
If your range of cells on Sheet2 is a named range, I believe you might be able to use the LIBNAME engine to write to that range of cells. However, what I don't remember is whether you can overwrite what might be in those cells with something else.

That's probably a question for Tech Support. Partly, I think the answer will depend on what version of SAS you have and how you plan to do the export and what SAS/Access products you have (such as SAS/Access to PC Files) and whether you need the PC File Server.

Cynthia
EHittner
Fluorite | Level 6

Hi Cynthia.  Apologies for the delay in response.  Ultimately I'd like to just develop and format the entire report in SAS and just export it to the location I need it in.  This is more of a bridge process to that point.  I will, however, give your suggestion a shot -- and let you know how it goes.  Much appreciated!

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1381 views
  • 0 likes
  • 2 in conversation