Basic operations with worksheets.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
character. sheet name/new sheet name
character/numeric. sheet name or sheet number in active workbook before which new sheet will be added
character/numeric. sheet name or sheet number in active workbook
xl.sheet.add adds new sheet with given name and invisibly
returns name of this newly added sheet. Added sheet become active. If
xl.sheet.name is missing default name will be used. If
argument is missing, sheet will be added at the last position. If sheet with
given name already exists error will be generated.
xl.sheet.name rename active sheet. If its argument is missing
then it just return active sheet name.
xl.sheet.show hide and show sheet by its
xl.sheet.visible returns current visibility status of the
xl.sheet.activate activates sheet with given name/number. If
sheet with this name doesn't exist error will be generated.
xl.sheet.delete deletes sheet with given
name/number. If name doesn't submitted it delete active sheet.
invisibly return name of created/activated/duplicated sheet.
xl.sheets returns vector of sheet names in active workbook.
xl.sheet.delete invisibly returns NULL.
1 2 3 4 5 6 7 8 9 10 11 12 13
## Not run: xl.workbook.add() sheets = xl.sheets() xl.sheet.add("Second") xl.sheet.add("First", before="Second") for (sheet in sheets) xl.sheet.delete(sheet) # only 'First' and 'Second' exist in workbook now xl.sheet.activate("Second") #last sheet activated xl.sheet.duplicate() # duplicate second sheet xl.sheet.name() # "Second (2)" xl.sheet.name("Third") # "Third" ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.