date format and random

jefflee

Board Regular
Joined
Jun 8, 2015
Messages
79
Hi, I am new to this forum and learning vba for 2 years but still no progress.
I am now seeking for help;

cell a1 is a value to be entered
cell a2 is the final time converted from cell a1

if I want cell a2 to be in the time format say 17:13:48 and I want the numbers entered in a1 is 171348 . is it possible ?

I am now entered 17.23 in cell a1 and a2 as a1/24 and return the time 17:13:48

but it is very difficult for me to enter the exact time . ( the other way I know is using 3 cells to contain the three values . )

if i just use 171348 and returns 17:13:48 , if would be great !!

regards
jeff
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

InfoH

Board Regular
Joined
Nov 1, 2011
Messages
60
you could have it by doing: =LEFT(A1,2)&":"&MID(A1,3,2)&":"&RIGHT(A1,2)

bit crude but gets the job done
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,982
Messages
5,834,682
Members
430,309
Latest member
Deepjuillet

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
Top