Python Forum
Applying row height to all rows including and after row 7
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Applying row height to all rows including and after row 7
#1
Using openpyxl, I cannot figure out how to apply a row height on an existing worksheet unless I do it one row at a time.

This works for a single row:
ws4.row_dimensions[14].height = 25
But I want to set the row height for row 7 and any subsequent rows.

This approach does nothing yet does not throw an error:
for rows in ws4.iter_rows(min_row=7, max_row=None):
    ws4.row_dimensions.height = 25
wb4.save('C:\\folder\\DataplusRows.xlsx')
Any idea how to do this? I can't glean the answer from the openpyxl documentation. And I can't seem to find examples anywhere.
Reply


Messages In This Thread
Applying row height to all rows including and after row 7 - by curranjohn46 - Oct-14-2019, 10:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function to count words in a list up to and including Sam Oldman45 15 6,756 Sep-08-2023, 01:10 PM
Last Post: Pedroski55
  gspread - applying ValueRenderOption to a range of cells dwassner 0 1,719 Jan-12-2022, 03:05 PM
Last Post: dwassner
  The code I have written removes the desired number of rows, but wrong rows Jdesi1983 0 1,649 Dec-08-2021, 04:42 AM
Last Post: Jdesi1983
  Including data files in a package ChrisOfBristol 4 2,604 Oct-27-2021, 04:14 PM
Last Post: ChrisOfBristol
  Not including a constructor __init__ in the class definition... bytecrunch 3 12,074 Sep-02-2021, 04:40 AM
Last Post: deanhystad
  Pandas DataFrame combine rows by column value, where Date Rows are NULL rhat398 0 2,142 May-04-2021, 10:51 PM
Last Post: rhat398
  image.thumbnail(width, height) not working PCesarano 2 3,473 Apr-08-2021, 06:09 PM
Last Post: PCesarano
  Applying function mapypy 1 2,291 Mar-11-2021, 09:49 PM
Last Post: nilamo
  Indexing [::-1] to Reverse ALL 2D Array Rows, ALL 3D, 4D Array Columns & Rows Python Jeremy7 8 7,235 Mar-02-2021, 01:54 AM
Last Post: Jeremy7
  how to create pythonic codes including for loop and if statement? aupres 1 1,948 Jan-02-2021, 06:10 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020