Im trying to change a custom date format to dd/mm/yyyy.
The code below works for the current worksheet but wont work for all worksheets.
Sub dateformat()
Dim ws As Worksheet
For Each ws In Worksheets
Columns("E:E").Select
Selection.NumberFormat = "dd/mm/yyyy;@"
'MsgBox ws.Name
Next ws
End Sub
its hard to manually run the macro per column as the workbook has 100+ sheets.
any thoughts on how i can get this to work?
This works for me:
Avoid selecting, it’s unreliable and unnecessary. Also “worksheets” should have a workbook.