Dear Excel specialist
I have an VBA code that checks if the last edit is bigger than last print.
The Last edit date is being created with the VBA NOW value when an edit is found within a range. This value is then pasted in a cell within the table.
Then there is a print option to print the information within the table to a pdf file using a word template. After printing the last print is stored in a cell within the table also using the NOW value.
I store the dates in
Lastedit = .range("AA" & Currentusedrow).value
Lastprint = .range ("AB" & Currentusedrow).value
Within the cells the Value is shown correctly as a full date & Time
(Currentusedrow is a row in a for loop
Cell is a fixed cell lest assume AA and AB)
During the run I request the information with a debug.print
Debug.Print "Last print:" & LastPrint
Debug.Print "Last Edit:" & LastEdit
Debug print shows:
last print: 44762
Last edit: 19-7-2022 11:34:38
To double check i also did
Range("B8").Value = LastPrint
Range("B9").Value = LastEdit
Here the lastprint also just shows the number
If I then do
Range("B2").Value = .Range("AB" & Currentusedrow).Value
then it shows the correct value in B2.
The print module needs the hours and minutes and seconds of the last print also
cause when the last edit is bigger than last print then it starts printing the document else it would not.
Why would this be the case?
I have an VBA code that checks if the last edit is bigger than last print.
The Last edit date is being created with the VBA NOW value when an edit is found within a range. This value is then pasted in a cell within the table.
Then there is a print option to print the information within the table to a pdf file using a word template. After printing the last print is stored in a cell within the table also using the NOW value.
I store the dates in
Lastedit = .range("AA" & Currentusedrow).value
Lastprint = .range ("AB" & Currentusedrow).value
Within the cells the Value is shown correctly as a full date & Time
(Currentusedrow is a row in a for loop
Cell is a fixed cell lest assume AA and AB)
During the run I request the information with a debug.print
Debug.Print "Last print:" & LastPrint
Debug.Print "Last Edit:" & LastEdit
Debug print shows:
last print: 44762
Last edit: 19-7-2022 11:34:38
To double check i also did
Range("B8").Value = LastPrint
Range("B9").Value = LastEdit
Here the lastprint also just shows the number
If I then do
Range("B2").Value = .Range("AB" & Currentusedrow).Value
then it shows the correct value in B2.
The print module needs the hours and minutes and seconds of the last print also
cause when the last edit is bigger than last print then it starts printing the document else it would not.
Why would this be the case?