PHP code example of reandimo / google-sheets-helper
1. Go to this page and download the library: Download reandimo/google-sheets-helper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$sheet1 = new Helper();
$sheet1->setSpreadsheetId('somesheetid');
$sheet1->setWorksheetName('Sheet1'); // select the Worksheet you want to duplicate
$newWorksheetName = 'New Duplicated Sheet'; // The name of the new sheet
$sheet_id = $sheets->duplicateWorksheet($newWorksheetName);
// Get updated cells
if($sheet_id){
echo 'The sheet was duplicated B)';
}
$sheet1 = new Helper();
$sheet1->setSpreadsheetId('somespreadsheetid');
$sheet1->setWorksheetName('Sheet1');
$sheet1->setSpreadsheetRange('A1:Z10');
$sheet1->colorRange([142, 68, 173]);
Helper::getColumnLettersIndex('AZ'); // this will return 52