1

Can anyone advise me on how to set the horizontal alignment of a cell with pygsheets.

I have been attempted to do so via the model_cell approach. One such attempt being the following:

model_cell = wks.cell('A1')
model_cell.set_horizontal_alignment("Center")
rng = wks.get_values("A1", "D4"), returnas='range')
rng.apply_format(model_cell)

I have no issues setting the other properties such as font, but only because I have been able to modify existing code examples. The horizontal alignment appears to use a different format.

David Kane
  • 135
  • 8

1 Answers1

1

I solved this myself!

model_cell.set_horizontal_alignment( pygsheets.custom_types.HorizontalAlignment.CENTER )

If anyone could provide a small explanation as to why different format schemas exist for different questions I'd be much obliged.

David Kane
  • 135
  • 8