Macro code problem

Peter_1985 2,866 Reputation points
2024-04-11T04:33:05.8366667+00:00

Hi,

It is having

User's image

to the line like

Worksheets(List1).Cells(RowID2, 8).Value = Format(Now - Worksheets(List0).Cells(RowID, 7).Value, "Standard")

Worksheets(List0).Cells(RowID, 7).Value is having the value below.

21/07/2020 6:02:59 PM

How to resolve it?

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
{count} votes

Answer accepted by question author
  1. Olaf Helper 47,586 Reputation points
    2024-04-11T06:31:34.7633333+00:00

    Click on "Debug" and check all values.

    And use the function CDATE for en explict conversion from string to date, see

    https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.