Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 434
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"