C++ ile Worksheet te Hücre Aralığını Taşıma

Çalışma Sayfasında Hücre Aralığını Taşıma

Örnek kod, görevi göstermek için bir şablon dosyası kullanır.

Giriş dosyası

todo:image_alt_text

Lütfen A1:B5 aralığındaki hücreleri C1:D5’e taşıyan oluşturulan dosyayı inceleyin.

Çıkış dosyası

todo:image_alt_text

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Instantiate the workbook object. Open the Excel file
    U16String inputFilePath = u"book1.xlsx";
    Workbook workbook(inputFilePath);

    // Access the first worksheet and its cells
    Worksheet worksheet = workbook.GetWorksheets().Get(0);
    Cells cells = worksheet.GetCells();

    // Create a range from A1 to B5
    Range range = cells.CreateRange(u"A1", u"B5");

    // Move the range to the right by 2 columns
    range.MoveTo(0, 2);

    Aspose::Cells::Cleanup();
}