TASK_COPY

Function Overview

The TASK_COPY function copies data and formatting from a source range to a destination range, possibly across different sheets in the same spreadsheet. It preserves cell values, formulas, and formatting while allowing you to replicate content between different parts of your spreadsheet.

Uses

  1. Create a duplicate of data with the same formatting in another part of the spreadsheet
  2. Transfer formatted templates from one sheet to another
  3. Copy a range of cells containing formulas without breaking references
  4. Replicate charts, tables, or dashboards to another location
  5. Create backup copies of important data within the same spreadsheet
  6. Apply consistent formatting across multiple sections of your spreadsheet
  7. Duplicate row or column headers across different sheets
  8. Fill a larger target range with repeated copies of a smaller source range
  9. Transfer conditional formatting rules between ranges
  10. Copy a range of cells while preserving data validation rules

Syntax and Parameters

=TASK_COPY(header, source_range, destination_range, [source_sheet], [destination_sheet])

Parameter Data Type Required Description
header string Yes Column header for the task template
source_range string Yes The range to copy from in the source sheet (e.g., "A1:B10")
destination_range string Yes The range to copy to in the destination sheet (e.g., "C1:D10")
source_sheet string No The name of the source sheet (e.g., "Sheet1"). If not specified, uses the active sheet
destination_sheet string No The name of the destination sheet (e.g., "Sheet2"). If not specified, uses the active sheet

Advanced Options

Different-Sized Ranges

When the destination range has different dimensions than the source range, TASK_COPY handles this by repeating the source content to fill the destination. For example:

  • If the destination is larger, the source content will be repeated to fill it
  • If the destination is smaller, only a portion of the source content will be copied

Cross-Sheet Copying

You can copy between different sheets in the same spreadsheet by specifying the source_sheet and destination_sheet parameters. This allows you to maintain consistent data and formatting across multiple sheets.

Formula Handling

TASK_COPY preserves formulas from the source range. When a formula is copied, it maintains its relative references, similar to how Google Sheets' native copy-paste functionality works.

Formatting Preservation

All formatting attributes from the source range are applied to the destination range, including:

  • Font styles (bold, italic, size, color)
  • Cell background colors
  • Borders
  • Number formats
  • Conditional formatting rules
  • Data validation rules

Examples

Example 1: Copy within the same sheet

=TASK_COPY("Header", "A1:B10", "D1:E10")

This copies the content and formatting from cells A1:B10 to cells D1:E10 in the active sheet. After clicking "Run" in the sidebar, the destination range will contain an exact duplicate of the source range.

Example 2: Copy between different sheets

=TASK_COPY("Header", "A1:C5", "A1:C5", "Data", "Summary")

This copies cells A1:C5 from the "Data" sheet to the same position in the "Summary" sheet. After clicking "Run" in the sidebar, the destination range in the "Summary" sheet will match the source range in the "Data" sheet.

Example 3: Filling a larger destination with repeated content

=TASK_COPY("Header", "A1:A1", "B1:B10")

This copies the value and formatting from cell A1 and repeats it to fill cells B1:B10. This is useful for creating column headers or applying consistent formatting to a range.

Example 4: Copying formatted templates

=TASK_COPY("Header", "TemplateSheet!A1:E10", "A1:E10", "TemplateSheet", "NewData")

This copies a pre-formatted template from the "TemplateSheet" to the "NewData" sheet, preserving all formatting and formulas.

Example 5: Copying a smaller section to a specific location

=TASK_COPY("Header", "Data!B5:D15", "F10:H20", "Data", "Summary")

This copies a specific section from one sheet to a different location in another sheet while preserving all content and formatting.

Best Practices

  1. Remember to click "Run" in the Sheet Workflows sidebar after entering the TASK_COPY formula
  2. Use meaningful range references to clearly indicate which content is being copied
  3. When copying between sheets, verify both sheet names exist in the spreadsheet
  4. For complex formulas, check that cell references update correctly after copying
  5. Consider using absolute references in your source formulas ($A$1) if you want them to remain fixed after copying
  6. Test with smaller ranges first before performing large copy operations
  7. If you need to preserve specific formatting, check that all attributes were correctly transferred
  8. Be cautious when copying to ranges that contain important existing data
  9. When filling larger ranges with smaller source ranges, verify that the pattern repeats as expected
  10. Use this function instead of manual copy-paste when you need to repeat the same operation multiple times

Troubleshooting

Error: Invalid input

Cause: The function received invalid input or no input at all.
Solution: Make sure all required parameters (header, source_range, destination_range) are provided and properly formatted.

Error: Invalid JSON

Cause: The JSON string generated by TASK_COPY has been modified or corrupted.
Solution: Don't manually edit the JSON string in the cell. Re-create the TASK_COPY formula from scratch.

Error: Invalid function

Cause: The function parameter in the JSON doesn't match "TASK_COPY".
Solution: Ensure you're using TASKCOPY correctly and haven't mixed it with another TASK* function.

Error: Missing ranges

Cause: The source_range or destination_range parameters are missing or empty.
Solution: Provide both source_range and destination_range parameters with valid A1 notation.

Error: Source sheet not found

Cause: The specified source sheet doesn't exist in the spreadsheet.
Solution: Check the spelling of the source_sheet parameter and make sure the sheet exists.

Error: Destination sheet not found

Cause: The specified destination sheet doesn't exist in the spreadsheet.
Solution: Check the spelling of the destination_sheet parameter and make sure the sheet exists.

Error: Invalid range

Cause: One or both of the specified ranges are invalid A1 notation.
Solution: Ensure that both source_range and destination_range use valid A1 notation (e.g., "A1:B10").

Warning: Formatting error

Cause: There was an issue copying the formatting from the source to the destination.
Solution: The values and formulas will still be copied, but you may need to manually fix some formatting.

FAQ

How is TASK_COPY different from regular copy and paste?

TASK_COPY works similarly to copy-paste but can be saved as a reusable formula, automated as part of a workflow, and handles different-sized ranges by repeating content as needed.

Does TASK_COPY work with formulas?

Yes, TASK_COPY preserves formulas and copies them to the destination range. Relative references in formulas will adjust based on the new location, just like normal copy-paste.

Can I copy between different spreadsheets?

No, TASK_COPY only works within the same spreadsheet. You can copy between different sheets, but not between different spreadsheet files.

Will TASK_COPY overwrite existing data in the destination range?

Yes, any data in the destination range will be overwritten when you run TASK_COPY. Be careful when copying to ranges that contain important information.

How does TASK_COPY handle merged cells?

TASK_COPY will copy the values and formatting of merged cells, but it won't merge cells in the destination range. You may need to manually merge cells in the destination if needed.

Can I use TASK_COPY with protected sheets or ranges?

TASK_COPY will work as long as you have edit permission for both the source and destination ranges. If either range is protected and you don't have permission, the operation will fail.

What happens if my source and destination ranges have different dimensions?

If the destination range is larger than the source range, TASK_COPY will repeat the source content to fill the destination. If the destination is smaller, only a portion of the source content will be copied.

Does TASK_COPY copy hidden rows or columns?

Yes, TASK_COPY copies all cells in the specified ranges, regardless of whether they're hidden or not.

Can I use TASK_COPY to copy only values without formulas?

No, TASK_COPY always copies both values and formulas. If you only want values, you would need to manually paste as values after using TASK_COPY.

Does TASK_COPY copy comments and notes?

No, TASK_COPY doesn't copy cell comments or notes. It only copies values, formulas, and formatting.

Can TASK_COPY be used in an automated workflow?

Yes, you can include TASK_COPY in automated workflows, but remember that the "Run" button in the sidebar must be clicked to execute the copy operation.

How do I know if TASK_COPY has completed successfully?

After clicking "Run" in the sidebar, a success message will appear indicating that data has been copied from the source range to the destination range.

Elisha

1 week ago

Categories
Features