Weight with text. removing text changes weight to date.

xluserg

Board Regular
Joined
Jan 30, 2010
Messages
121
Office Version
  1. 365
Platform
  1. Windows
hi all

googled with no joy.

I have a weight with text when I remove the text it changes the weight to a date. But I need just the weight to stay as it is.


in a cell I have 8-10 p

I remove the space and the p by macro. could be space then any other text.

changes to 08-Oct I just need it to show 8-10

Thankyou


Graham



 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
If you format the range you are dealing with as "text" format, when you remove the " p" suffix the cell will still display "8-10." You could do this before you run the macro to delete the suffixes, or make it part of the macro (set the cell's numberformat property to "@"). Alternatively, you could change the macro to enter an apostrophe before the cell value when you are removing the " p" suffix.
 
Upvote 0
Hi Dean


could'nt get your first method to work so used your second method, that worked fine!


Thanks Dean.


Brilliant!


Graham
 
Upvote 0
Sounds like you are sorted, but here is yet another method if the text part always has a space before it.
Select the column by clicking its heading label -> Data ribbon tab -> Text to Columns -> Delimited -> Next -> Mark the Space box -> Next -> (first column at the bottom should be highlighted) Choose Text at the top -> Click in the 2nd column at the bottom & choose Do not import at the top -> Finish
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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