en_passant
New Member
- Joined
- Feb 10, 2016
- Messages
- 13
Hi guys,
I'm trying to change the format of cells and move them to another excel sheet.
The format is this: 19/07/2016 03:22:49 - which is - yy(end of 2019)/mm/yy(beginning of 2019)dd, so yy/mm/yydd.
I'm changing it so it shows as dd/mm/yy and when I run this code - the format changes as I want it to (with the sheet already open):
' Workbooks.Open Filename:="C:\Users\epass\Desktop\800xxx.csv"
Windows("800xxx.csv").Activate
Range("B2:B10").Select
Selection.NumberFormat = "yy/mm/dd hh:mm:ss"
This macro is saved in another sheet. When I then close the sheet and run this:
Workbooks.Open Filename:="C:\Users\epass\Desktop\800xxx.csv"
Windows("800xxx.csv").Activate
Range("B2:B10").Select
Selection.NumberFormat = "yy/mm/dd hh:mm:ss"
It does not change the format. It remains as it is above. The format shows as having been changed but the text in the cell hasn't changed and whatever I do with the format options it won't allow it to change after that code has run.
Regards,
*e_p
I'm trying to change the format of cells and move them to another excel sheet.
The format is this: 19/07/2016 03:22:49 - which is - yy(end of 2019)/mm/yy(beginning of 2019)dd, so yy/mm/yydd.
I'm changing it so it shows as dd/mm/yy and when I run this code - the format changes as I want it to (with the sheet already open):
' Workbooks.Open Filename:="C:\Users\epass\Desktop\800xxx.csv"
Windows("800xxx.csv").Activate
Range("B2:B10").Select
Selection.NumberFormat = "yy/mm/dd hh:mm:ss"
This macro is saved in another sheet. When I then close the sheet and run this:
Workbooks.Open Filename:="C:\Users\epass\Desktop\800xxx.csv"
Windows("800xxx.csv").Activate
Range("B2:B10").Select
Selection.NumberFormat = "yy/mm/dd hh:mm:ss"
It does not change the format. It remains as it is above. The format shows as having been changed but the text in the cell hasn't changed and whatever I do with the format options it won't allow it to change after that code has run.
Regards,
*e_p