xxxxxxxxxx
import openpyxl
# Load the Excel file
workbook = openpyxl.load_workbook('your_file.xlsx')
# Select the desired worksheet
sheet = workbook['Sheet1']
# Iterate through all cells in a specific column (e.g., column A)
for cell in sheet['A']:
if isinstance(cell.value, float):
# Remove decimal places by converting the value to an integer
cell.value = int(cell.value)
# Save the modified Excel file
workbook.save('your_modified_file.xlsx')