Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert "-" in already fill cell
I have large amount of cells with values like that; "6XX01LAA AA01" now what
I want is to insert "-" with in this text value for example; "6-XX-01-LAA-AA- 01" how is it possible??? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200809/1 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert "-" in already fill cell
Hi,
With your text in A1 down, put this in B1 and drag down. =LEFT(A1,1)&"-"&MID(A1,2,2)&"-"&MID(A1,4,2) &"-"&MID(A1,6,3)&"-"&MID(A1,9,2)&"-"&MID(A1,11,2) That will work for your example as provided assuming that the space in the middle of your example is a typo. HTH Martin "adeel via OfficeKB.com" <u32736@uwe wrote in message news:8a2ab1b1c798b@uwe... I have large amount of cells with values like that; "6XX01LAA AA01" now what I want is to insert "-" with in this text value for example; "6-XX-01-LAA-AA- 01" how is it possible??? -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200809/1 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert "-" in already fill cell
hi, adeel !
I have large amount of cells with values like that; "6XX01LAA AA01" now what I want is to insert "-" with in this text value for example; "6-XX-01-LAA-AA-01" how is it possible??? you can do it "in-place" with a macro (in one single step) just revise/adjust/... your real range (address) and modify/adapt (don't miss Martin's comment regarding "the space") hth, hector. Sub Test() Dim d As String With Range("a2:a40") d = .Address .Value = Evaluate("transpose(transpose(" & _ "left(" & d & ")&""-""&" & _ "mid(" & d & ",2,2)&""-""&" & _ "mid(" & d & ",4,2)&""-""&" & _ "mid(" & d & ",6,3)&""-""&" & _ "mid(" & d & ",10,2)&""-""&" & _ "right(" & d & ",2)))") End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F | Excel Discussion (Misc queries) | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) | |||
Insert "-" in text "1234567890" to have a output like this"123-456-7890" | Excel Discussion (Misc queries) |