ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I paste in only absolute value of a measure (no units)? (https://www.excelbanter.com/excel-discussion-misc-queries/133917-can-i-paste-only-absolute-value-measure-no-units.html)

DMC

Can I paste in only absolute value of a measure (no units)?
 
I am trying paste in a large series of values that have a unit of measure
designator attached, therfore, is pasting in a text, rathe than a number.
Example: 120h, where I would like to paste in only 120. Is ther way to
convert text to number, or drop the "h" when pasting?

Bernard Liengme

Can I paste in only absolute value of a measure (no units)?
 
I cannot think of a Paste trick to do this (would be nice).

Is it always a SINGLE letter on the right?
then use a helper column with =--MID(A1,1,LEN(A1)-1); do a copy followed by
paste special - values. Now the helper column can replace the original
column.
The double negation converts text to number

If there are a limited number of units (say H, KM or DAYS):
=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h",""),"km"," "),"days","")

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"DMC" wrote in message
...
I am trying paste in a large series of values that have a unit of measure
designator attached, therfore, is pasting in a text, rathe than a number.
Example: 120h, where I would like to paste in only 120. Is ther way to
convert text to number, or drop the "h" when pasting?




Don Guillett

Can I paste in only absolute value of a measure (no units)?
 
Is this what you want?

Sub copypart()
range("e6").Value = Left(range("e5"), 3)
End Sub

--
Don Guillett
SalesAid Software

"DMC" wrote in message
...
I am trying paste in a large series of values that have a unit of measure
designator attached, therfore, is pasting in a text, rathe than a number.
Example: 120h, where I would like to paste in only 120. Is ther way to
convert text to number, or drop the "h" when pasting?




Leo Heuser

Can I paste in only absolute value of a measure (no units)?
 
"DMC" skrev i en meddelelse
...
I am trying paste in a large series of values that have a unit of measure
designator attached, therfore, is pasting in a text, rathe than a number.
Example: 120h, where I would like to paste in only 120. Is ther way to
convert text to number, or drop the "h" when pasting?


Another possibility:

=MAX(IF(ISNUMBER(VALUE(LEFT(A1,ROW(INDIRECT("1:"&L EN(A1)))))),VALUE(LEFT(A1,ROW(INDIRECT("1:"&LEN(A1 )))))))

To be confirmed with <Shift<Ctrl<Enter, also if edited later.

Works with any number of characters in the designator.


--
Best regards
Leo Heuser

Followup to newsgroup only please.





All times are GMT +1. The time now is 12:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com