Learn R Programming

openxlsx2 (version 0.8)

wb_clone_worksheet: Clone a worksheet to a workbook

Description

Clone a worksheet to a Workbook object

Usage

wb_clone_worksheet(wb, old = current_sheet(), new = next_sheet())

Value

The wb object

Arguments

wb

A wbWorkbook object

old

Name of existing worksheet to copy

new

Name of New worksheet to create

Details

Cloning is possible only to a limited extent. References to sheet names in formulas, charts, pivot tables, etc. may not be updated. Some elements like named ranges and slicers cannot be cloned yet.

See Also

Other workbook wrappers: wb_add_chartsheet(), wb_add_data_table(), wb_add_data(), wb_add_formula(), wb_add_pivot_table(), wb_add_worksheet(), wb_base_font, wb_col_widths, wb_copy_cells(), wb_creators, wb_freeze_pane(), wb_grouping, wb_merge_cells(), wb_save(), wb_set_last_modified_by(), wb_set_row_heights(), wb_workbook()

Examples

Run this code
# Create a new workbook
wb <- wb_workbook("Fred")

# Add worksheets
wb$add_worksheet("Sheet 1")
wb$clone_worksheet("Sheet 1", "Sheet 2")

Run the code above in your browser using DataLab