随着日期格式每次更改

时间:2020-02-27 23:59:06

标签: excel vba

每次尝试更改日期格式时,我都试图将日期值从“创建新客户”表复制到“客户数据”中

strName = Sheets("Create_New_Customer").Cells(14, 4).Value
strAddress = Sheets("Create_New_Customer").Cells(15, 4).Value
strTown = Sheets("Create_New_Customer").Cells(16, 4).Value
strPostcode = Sheets("Create_New_Customer").Cells(17, 4).Value
strTel = Sheets("Create_New_Customer").Cells(18, 4).Value
strEmail = Sheets("Create_New_Customer").Cells(19, 4).Value
strEqMk = Sheets("Create_New_Customer").Cells(20, 4).Value
strEqMdl = Sheets("Create_New_Customer").Cells(21, 4).Value
strEqType = Sheets("Create_New_Customer").Cells(22, 4).Value
strEqCost = Sheets("Create_New_Customer").Cells(23, 4).Value
strRentalStartDate = Sheets("Create_New_Customer").Cells(24, 4).Value
strCond = Sheets("Create_New_Customer").Cells(25, 4).Value
strPayT = Sheets("Create_New_Customer").Cells(26, 4).Value
strMonthRentalCost = Sheets("Create_New_Customer").Cells(27, 4).Value
strPaymentMehtod = Sheets("Create_New_Customer").Cells(28, 4).Value


With Sheets("CustomersData")
    .Cells(LastRow, 2).Value = strName
    .Cells(LastRow, 3).Value = strAddress
    .Cells(LastRow, 4).Value = strTown
    .Cells(LastRow, 5).Value = strPostcode
    .Cells(LastRow, 6).Value = strTel
    .Cells(LastRow, 7).Value = strEmail
    .Cells(LastRow, 8).Value = strEqMk
    .Cells(LastRow, 9).Value = strEqMdl
    .Cells(LastRow, 10).Value = strEqType
    .Cells(LastRow, 11).Value = strEqCost
    .Cells(LastRow, 12).Value = strRentalStartDate
    .Cells(LastRow, 13).Value = strCond
    .Cells(LastRow, 14).Value = strPayT
    .Cells(LastRow, 15).Value = strMonthRentalCost
    .Cells(LastRow, 16).Value = strPaymentMehtod

End With

0 个答案:

没有答案