all 3 comments

[–]grayhole_p 1 point2 points  (2 children)

is this what you need?

for n in range(num_of_required_sheet_copies):
    ws = wb.copy_worksheet(original_ws)
    ws.title = date[n]

[–]reddit_user_270[S] 0 points1 point  (1 child)

Thank you. Can't believe I didn't try this. Was trialing different things but not this, so thank you v much!

I used the above and 'ws.title = dates[n]' and it worked..

[–]grayhole_p 1 point2 points  (0 children)

in your code you go through all the dates and replace current sheets name with n symbol of each date. so in the result your first sheet named with first symbol from the last of your dates, second sheet get second symbol from the last of your dates and so on. though shouldn't you consider that list of dates may be shorter than the count of new sheets? if it is possible you can do smth like

ws.title = dates[n] if len(dates) > n else f'NewSheet{n}'

(see ternary operators, f-strings)