Code for Eliminating Letters In The Same Cell as a Number

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Hello All...
I have a little problem here.
I have a MS Project File, which inputs an entered number with "hrs" for hours. For example, If I enter 36 into the Project file cell, Project enters the number as: 36hrs.

The problem is if I copy and paste 36hrs into excel, I can't run compute with excel because it will not recognize 36hrs as 36. Is there code which will search column "C:C" to eliminate all the cells (within that column) to change the "hrs" numbered format to just a number?

Thanks for the help
excel 2013
 

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
No code needed for this.
If you select the column, and then do a Find/Replace, replacing "hrs" with nothing, it will remove all the "hrs" bits, and the rest will be changed to numbers.

If you want VBA code (because it is part of a larger process), simply turn on the Macro Recorder as you record the steps above, and you will have VBA code that does that.
 
Upvote 0
Got It...Keep Forgetting about the recorder
Thank you
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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