Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / PasteOptions Enumeration
ExampleExample


In This Topic
    PasteOptions Enumeration
    In This Topic
    Determines what kind of data will be pasted into the new location.
    Syntax
    'Declaration
     
    
    <FlagsAttribute()>
    Public Enum PasteOptions 
       Inherits System.Enum
    'Usage
     
    
    Dim instance As PasteOptions
    [Flags()]
    public enum PasteOptions : System.Enum 
    Members
    MemberValueDescription
    All15Pastes all of the Cell or CellRange's content, as well as how it is formatted.
    DataValidation8Pastes only the data validation rules found in the original Cell or CellRange.
    Formatting4Pastes only the formatting of the original Cell or CellRange.
    Formulas2Pastes only the formulas found in the original Cell or CellRange, without any formatting or comments. 
    None0Specifies that no mathematical operation will be applied to the pasted data.
    Transpose16Pastes & reorients the content of the original Cell or CellRange; this means that the data in Rows will be pasted into Columns & vice versa.
    Values1Pastes the formula results found in the original Cell or CellRange, without any formatting or comments.
    Remarks
    This is a bitwise enumeration, which means that many options can be set concurrently by using the pipe symbol ("|"). 
    Example
    // Copies a CellRange & pastes it, keeping the original formatting the the formula results (the values) only.
    worksheet.Cells[ "D4", "H12" ].CopyAndPasteTo( "D47", PasteOptions.Formatting | PasteOptions.Values );
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             Xceed.Workbooks.NET.PasteOptions

    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also