VBA copied date and paste in the reverse order

AlexPeteson

New Member
Joined
Feb 19, 2019
Messages
2
Hi Community

The following is an extract of my code. Basically, I'm copying rows of data from source workbooks to a mastercopy workbook.
All fields copied over are fine except for the date files. It went from 07/03/2019 (Source) to 03/07/2019 (Mastercopy).
Is there a value that i can fix this date? Paste special maybe? How can i edit the code based on the below string?
Any advice is greatly appreciated, thanks!

erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range(Cells(erow, 2), Cells(erow, 10))

Regards
Peteson
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,757
Office Version
  1. 365
Platform
  1. Windows
I assume you want dd/mm/yyyy
- you are making me guess because both 03 and 07 are less than 12 !!
- but I think you are referring to 7 March 2019 ???

Is this a simple formatting problem?
- add this line below ActiveSheet.Paste.... and amend the column to the one containing the dates
Code:
ActiveSheet.Columns("B").NumberFormat = "[COLOR=#ff0000]dd/mm/yyyy[/COLOR]"

It may not be a formatting problem
If above does not resolve the problem, look at the source data
Format the cell in the source 07/03/2019 as a NUMBER
if it changes to 43531 that is 7 March 2019
if it changes to 43649 that is 3 July 2019
 

Watch MrExcel Video

Forum statistics

Threads
1,109,142
Messages
5,527,069
Members
409,742
Latest member
setam

This Week's Hot Topics

Top