VBA debug doesnt show NOW info but number

Hirukaru

New Member
Joined
Jul 20, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top