Quantcast
Channel: Microsoft forum - dslreports.com
Viewing all articles
Browse latest Browse all 8524

[Excel] VBA copy command changing date format

$
0
0
I've got a sheet that I need to regularly copy columns A:K from into another sheet. Column B contains a date in dd/mm/yy format. When I copy it manually, it retains the format. When I automate it using VBA, if changes it to mm/dd/yy. It's not just a mater of resetting the format, it's actually transposing the date with the month, so 3rd Jun becomes 6th March. How do I fix? This is the copy code I'm using; Workbooks.Open Filename:= _ "J:\Myfiles\Register.xlsx" Columns("A:K").Select Selection.Copy ActiveWindow.Close Columns("A:K").Select Range("A3").Activate ActiveSheet.Paste

Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>