public static function getDistanceX(PHPExcel_Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0)
	{
		$distanceX = 0;

		// add the widths of the spanning columns
		$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; // 1-based
		$endColumnIndex = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; // 1-based
		for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) {
			$distanceX += self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($i));
		}

		// correct for offsetX in startcell
		$distanceX -= (int) floor(self::sizeCol($sheet, $startColumn) * $startOffsetX / 1024);

		// correct for offsetX in endcell
		$distanceX -= (int) floor(self::sizeCol($sheet, $endColumn) * (1 - $endOffsetX / 1024));

		return $distanceX;
	}
public static function getDistanceX(PHPExcel_Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0)
	{
		$distanceX = 0;

		// add the widths of the spanning columns
		$startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; // 1-based
		$endColumnIndex = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; // 1-based
		for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) {
			$distanceX += self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($i));
		}

		// correct for offsetX in startcell
		$distanceX -= (int) floor(self::sizeCol($sheet, $startColumn) * $startOffsetX / 1024);

		// correct for offsetX in endcell
		$distanceX -= (int) floor(self::sizeCol($sheet, $endColumn) * (1 - $endOffsetX / 1024));

		return $distanceX;
	}
public static function getDistanceX ( PHPExcel_Worksheet $ sheet , $ startColumn = 'A' , $ startOffsetX = 0 , $ endColumn = 'A' , $ endOffsetX = 0 ) { $ distanceX = 0 ; // add the widths of the spanning columns $ startColumnIndex = PHPExcel_Cell :: columnIndexFromString ( $ startColumn ) - 1 ; // 1-based $ endColumnIndex = PHPExcel_Cell :: columnIndexFromString ( $ endColumn ) - 1 ; // 1-based for ( $ i = $ startColumnIndex ; $ i <= $ endColumnIndex ; ++ $ i ) { $ distanceX += self :: sizeCol ( $ sheet , PHPExcel_Cell :: stringFromColumnIndex ( $ i ) ) ; } // correct for offsetX in startcell $ distanceX -= ( int ) floor ( self :: sizeCol ( $ sheet , $ startColumn ) * $ startOffsetX / 1024 ) ; // correct for offsetX in endcell $ distanceX -= ( int ) floor ( self :: sizeCol ( $ sheet , $ endColumn ) * ( 1 - $ endOffsetX / 1024 ) ) ; return $ distanceX ; }
Get the horizontal distance in pixels between two anchors
The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets

@param PHPExcel_Worksheet $sheet
@param string $startColumn
@param integer $startOffsetX Offset within start cell measured in 1/1024 of the cell width
@param string $endColumn
@param integer $endOffsetX Offset within end cell measured in 1/1024 of the cell width
@return integer Horizontal measured in pixels
Get the horizontal distance in pixels between two anchors The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets