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
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,214
Messages
5,594,881
Members
413,947
Latest member
gizmolucy

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