VBA Code to force cell value into time format

Malcolm torishi

Board Regular
Joined
Apr 26, 2013
Messages
219
Hello
can any help please, I have a VBA Code that sends an email automatically from a spread sheet. With the code there is a section that allows me to write some word that will appear with the email. Also attached to the wording is “& range (AA6 ) “that takes a formatted time (10:18) and inserts it int the body of the email being sent. But because the cell on the spreadsheet AA6 is formatted to time, when it appears on the email it’s just numbers (0.67546) for example. Is it possible to force the value in the email to time format eg 10:18 rather than 0.67546
thank you
 

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.
Instead of using Range("AA6") which defaults to the value property of the range, try using Range("AA6").Text
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

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