I use SAS EG 6.1 to add sheets to an existing excel file (xlsx). I use a simple proc export with DBMS=xlsx. The data is written to the excelfile succesfully.
However it appears that formatting in Excel is taken from the already existing sheets. There also is a difference between cells that contains numbers vs. cells that contain text. For instance when in the existing sheet i used header 1 cell style, the numbers in the exported worksheets also had this header 1 style.
Screenshot of the existing sheet: Existing Worksheet
Screenshot of the added sheet (wrong formats)
The wrongly formatted added worksheet
I tried the following things:
- add an extra sheet without formatting and place this as first sheet in the workbook. My thought was the exported work sheets then wouldn't have the format either. No succes.
- add an extra sheet without formatting and place this as last sheet in the workbook. My thought was the exported work sheets then wouldn't have the format either. No succes.
2 alternative possible solutions i think of are:
1) using the pcfiles and ranges method. I will try this and post the results.
2) recreate the existing workbook and pray to see different results.
Did anyone have this experience and solved this problem?
update 17-1-2016: added screenshots and tried the procedure with a fresh excel workfile. The latter didn't result in succes.
Related
This is just a sample sheet, Sample Sheet but the names included in Column A on the Names Sheet are updated regularly. Constantly dragging the corresponding rows around is not a feasible solution. I have in actuality, a list of approximately 300 names and the Spreadsheet is being read by another spreadsheet. I need the corresponding rows to move accordingly with onOpen() function or with a button that updates the sheet.
I have looked all over Stack Overflow but I cannot find a solution to the problem. This is my first posting on this site in the hopes of finding a script or another solution that will solve this issue. I tinker around a bit with scripts but I am still a relative newbie. I don't even know where to begin with this.
I filled an Excel table via QXlsx (available on GitHub) with numbers that should in any case be treated as strings. In Excel the affected cells show a green triangle which says that the content is actually a number.
In Excel I found an option which suppresses the warnings. But I am searching for a solution within QXlsx. Thanks for your support.
I am trying to change formatting within an excel spreadsheet using SAS.
However, being a complete beginner to SAS, not sure how to go about it.
Googling lots made me get 'ODS Excel' and 'ODS Excel XP' as possible approaches.
'ODS Excel' is giving me corrupted files though, so I'm skipping that one.
Could someone please advise in detail on how to do something like below within each step I have written, preferably using 'ODS Excel XP'? Or if I am doing something wrong with 'ODS Excel' in my syntax, happy to use that as well.
Input file: /myfile.excel/
SAS:
Step 1: Read myfile.excel, which looks like this
Step 2: Turn the title row into bold text and that whole row yellow in colour, not just the cell with the text
Step 3: Output the formatting changes to new or existing excel, I don't really care
I have no idea how to do this in SAS. Could someone help, please?
Thank you!
Update: This is my SAS version: Custom Version 9.4_M3
Can cfspreadsheet (or anything else using cold fusion) be used to update just a few cells in an existing xlsx spreadsheet?
I have updated entire sheets in the past - using an object - but the sheet in question is so massive and messy - I only want to be able to edit a few of the cells - without have to read and validate ALL the columns.
basically the ability to use SpreadsheetSetCellValue directly on the spreadsheet as opposed to working only on the spreadsheet object that must be read in and updated/written back as an entire sheet.
I have created a spreadsheet in OpenOffice Calc that has multiple sheets for each month of the year. The sheet has some specific formulas and data laid out in several months.
Is there any easy way to go about modifying a formula and having it transfer across all the sheets?
Or if the format changes, is there a way to merge sheets through some type of macro or something?
If your data is laid out in a very regular way, you may be able to copy+paste the modified formula to each sheet and have it adjust the cell references correctly.
However, for this type of flexibility (being able to make a change in one location and have it reflected in how all existing data is displayed) a database is generally required. OpenOffice has a database component Base, and information from Base can easily be imported to Calc if you have specific spreadsheet requirements. The learning curve for Base is fairly long, but might be worthwhile if you handle this kind of data frequently.
A formula in the same place on several sheets need only be updated once provided the relevant sheets are grouped together first (click their tabs with Ctrl depressed - and don't forget to ungroup them when appropriate!). Fill applied to A1 of a group of sheets will colour A1 in each of those sheets.
The Consolidate feature (under Data) might be of interest.