Question

Hello, I would like to know how can I do wrap text for all sheet

  • 28 March 2022
  • 1 reply
  • 4 views

Hello, I would like to know how can I do wrap text for all sheet

1 reply

Userlevel 3
Badge +7

Hi @ahmed belal​ ,

 

Could you give this a try?

 

Set xlObj = CreateObject("Excel.Application")

xlObj.visible = False

 

'Filepath goes in here

Set xlFile = xlObj.Workbooks.open(WScript.Arguments.Item(0))

 

'Section which performs the wordwrapping

For Each wk In xlFile.Sheets

  wk.Cells.WrapText = True

Next

 

xlObj.ActiveSheet.Range("A1").Select

 

xlFile.Save

xlFile.Close

xlObj.Quit

 

Kind Regards,

Ashwin A.K

Reply