How to convert date/time value in specific short value

azad092

Board Regular
Joined
Dec 31, 2019
Messages
198
Office Version
  1. 2007
Platform
  1. Windows
Hi
Dear Members
good morning
I have a data sheet, that I have to export from the net in excel format. but when I export the data in excel sheet the date and time are shows in a single cell like this 2/2/2022 12:02:31 AM.
in this date and time value I have just required hours and mints without ":" sign like this 1202.
So I want to remove date value and ":" sign
Please guide me how I can do this by some excel formula or macro using VBA
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Can't you just right click > Format Cell to hmm AM/PM ?
 
Upvote 0
thanks for your kind attention
Yes I can do this by modifying cell format but I also want to remove the colon sign
 
Upvote 0
The format I've shown is without the colon sigh already. If you ignore the AM/PM, the results will become 002 because it is midnight. With the format shown, it was displayed as 1202 AM on my screen.
 
Upvote 0
you can see the actual time that I export from the net.... in the given list for example 2/2/2022 0:02 is shown in first row .... but I have required only 0002 without the colon sign ....with the day and night timings maybe the AM/PM sign also show in your side..but in my side it show in only formula bar but not in cell...and the AM/PM also not required... I required only simply value of time in four digit
Call Received at​
2/2/2022 0:02​
2/2/2022 0:06​
2/2/2022 0:11​
2/2/2022 0:21​
2/2/2022 0:24​
2/2/2022 0:25​
2/2/2022 0:33​
2/2/2022 0:41​
2/2/2022 0:42​
2/2/2022 0:44​
2/2/2022 0:45​
2/2/2022 0:48​
2/2/2022 0:51​
2/2/2022 1:06​
2/2/2022 1:08​
2/2/2022 1:20​
2/2/2022 1:23​
2/2/2022 1:28​
 
Upvote 0
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
 
Upvote 0
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
 
Upvote 0
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
 
Upvote 0
What I meant to say was that after importing the data, do the cell formatting. Are you trying to import the data and automatically formatted the cell to display the time as you mentioned? This would require to be done in macro during importation.
Hi
dear
thanks for your kind attention
Yes you are right... it will require a macro to covert the long date/time into four digits value without colon
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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