나는이 기본 문자를 영국 표준 날짜 "yyyy-mm-dd"로 변경 한 다음 문자열로 변환하여이 기본 문자를 작성했습니다. 내 목적을 위해 작업하기가 쉽기 때문에 문자열로 변환하기 전에 형식을 변경하고 싶습니다. 그러나 문자열은 셀 형식이 변경되었지만 원래의 미국 형식으로 보존 된 것으로 보입니다. 이 문제를 어떻게 해결할 수 있으며 그 이유는 무엇입니까?날짜 서식을 문자열로
Sub Changedate()
Sheet1.Cells(1, 3).Select
Selection.NumberFormat = "yyyy-mm-dd;@"
Sheet1.Cells(1, 4).Select
Selection.NumberFormat = "yyyy-mm-dd;@"
Dim firstDate As String
Dim secondDate As String
firstDate = Str(Sheet1.Cells(1, 3).Value)
secondDate = Str(Sheet1.Cells(1, 4).Value)
MsgBox firstDate
Sheet1.Cells(1, 3).Select
Selection.NumberFormat = "m/d/yyyy"
Sheet1.Cells(1, 4).Select
Selection.NumberFormat = "m/d/yyyy"
End Sub
** 실제로 ** ** 셀에 표시되는 일반적인 값은 무엇입니까 ....... "형식"값입니까? –