Changing a cell contents to time format
I have a ton of cells which contain numbers such as 6:20a for time. There are also a bunch of cells which contain the time 10:00p which is in the PM. I've tried everything to convert these to Excel's time format of 6:20 AM (and 10:00 PM) with no luck.
I formatted the cells and everything. I did find out that if I go to each cell and delete the "a", when I click "enter" the time format will work, (but probably not for the PM times) but like I said, I have a ton of cells to fix. Anyone have a suggestion?
Keys to the Problem Changing a cell contents to time format
From your description, it looks like the values are text values.
The following macro will convert the cells within the selection to time values.
Dim rng As Range
Application.ScreenUpdating = False
For Each rng In Selection
Select Case LCase(Right(rng.Value, 1))
Case "a", "p"
rng.Value = CDate(Left(rng.Value, Len(rng.Value) - 1) & " " & Right(rng.Value, 1))
rng.NumberFormat = "h:mm AM/PM"
Application.ScreenUpdating = True
Make Sure that your Computer Meets the System Requirements
Microsoft Windows Requirements :
- 1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64) processor
- 1 gigabyte (GB) RAM (32-bit) or 2 GB RAM (64-bit)
- 16 GB available hard disk space (32-bit) or 20 GB (64-bit)
You need to double-check your computer's hardware configuration against the following Microsoft requirements. If your PC hardware is not up to par, then make sure you update where necessary before continuing.
Another Safe way to Fix the Problem: Changing a cell contents to time format:
How to Fix Changing a cell contents to time format with SmartPCFixer?
1. You can Download SmartPCFixer here. Install it on your system. When you open SmartPCFixer, it will perform a scan.
2. After the scan is finished, you can see the errors and problems which need to be repaired.
3. When the Fixing part is done, your computer has been speeded up and the errors have been fixed
Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.18.104.22.168,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.22.214.171.12486,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.126.96.36.1990,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.188.8.131.529,Method to Update & Download ASUS K41VD Intel INF Update Driver v.184.108.40.2065,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: Troubleshoot:Certificates expired or not,Solution to Error: Chart Data Labels,How to Fix - Click on drive says "Location not available"?,How to Fix Error - cant donwload files - Once download finishes, the file doesn't save?,chart title month/year [Solved],Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver