Thank you guys for the reply. Here is the solution:
for ($column = 'G'; $column != 'AJ'; $column++) {
for ($row = 1; $row <= $endRow; $row++) {
$cellIndex = $column.$row;
}
}