Microsoft Integration with SAS

Using SAS with Microsoft Azure and Microsoft applications
BookmarkSubscribeRSS Feed
vt123
Calcite | Level 5

Hi I am trying to include some code with in the Data _null_ to conditional format a column SAS exported excel sheet. I need help with this is there any way to loop through the cells and check for a value and color the cell based on the value

5 REPLIES 5
Reeza
Super User

1. Can you apply conditional formatting to the cells in Excel and then export the data to those cells instead? The conditional formatting will follow.

2. Otherwise, as you export the data, you can check the value and apply the back ground colour. This assumes you're using PUT statements to export your data. If you use PROC export this won't work.

ChrisBrooks
Ammonite | Level 13

I wouldn't use DDE - it's very old, awkward to work with and I believe no longer supported by Microsoft anyway. There are some better options detailed here using Proc Print, Proc Report etc.

vt123
Calcite | Level 5
Hi thanks for you suggestions. I ended up moving the SAS code to excel and did the co ditional formatting using VBA
vt123
Calcite | Level 5
Hi Reeza could you please provide an example of thesecond option that you mentioned. Thanks!
Reeza
Super User

@vt123 wrote:
Hi Reeza could you please provide an example of thesecond option that you mentioned. Thanks!

Google can...
Page 5/Section 6 -Formatting of Excel Worksheet Cells

 

http://www2.sas.com/proceedings/sugi27/p005-27.pdf

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Discussion stats
  • 5 replies
  • 2395 views
  • 0 likes
  • 3 in conversation