复制单元格时出现问题(当我想要dd / mm / yyyy时,默认为mm / dd / yyyy)

我在下面有一些代码查找任何更改,并find其他工作表上的匹配,并更新任何更改,但是转移的date从英国格式的dd / mm / yyyy到美国风格datemm / dd / yyyy使表单中的所有date都不正确。

有人可以帮助,并build议我如何保持同样的方式? 谢谢!”

Dim s1rw As Long, s2rw As Long, col As Long, endcol As Long Sheets("Sheet1").Select With Sheets("Sheet2") s2rw = 2 ' Adjust to first data row # endcol = .Cells(s2rw - 1, 1).End(xlToRight).Column Do Until .Cells(s2rw, 1).Value = "" ' Loop through case #s s1rw = 0 On Error Resume Next s1rw = Cells.Find(What:=.Cells(s2rw, 1).Value, LookIn:=xlFormulas, LookAt:=xlWhole).Row On Error GoTo 0 If s1rw > 0 Then ' Found case # For col = 1 To endcol ' Loop through columns If Cells(s1rw, col).Value <> "" Then .Cells(s2rw, col).Value = Cells(s1rw, col).Value End If Next End If Rows(s2rw).Delete s2rw = s2rw + 1 Loop .Select End With 

用于更改单元Range.NumberFormat()方法将允许您在VBA代码中设置自己的自定义格式。 http://msdn.microsoft.com/en-us/library/office/ff196401%28v=office.15%29.aspx