Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Formatting problem

Hi All

I've got about 1000 rows or so of entries which have the following
format in each cell:

(20 spaces at least)A1234567890~Name

What I would like is to have two version of the formula where I have
just the no. and name but without the "~" and a " " there instead. The
other version would be to have the same as above but with the letter
as well, ie
"A1234567890 Name"

What I have so far:

=REPT("",LEN(LEFT(A3,FIND("~",A3)-1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)-1))))&MID(A3,FIND("~",A3)+1,500) - Name
only but no number

=TRIM(LEN(LEFT(A3,FIND("~",A3)+1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)+1)))&SUBSTITUTE(A3," ~"," ")) = 20 No.
and name

I'm still getting to grips with this, so if someone could point me in
the right direction, I'd be grateful!

Cheers!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Formatting problem

On Sep 27, 2:21*pm, Stav19 wrote:
Hi All

I've got about 1000 rows or so of entries which have the following
format in each cell:

(20 spaces at least)A1234567890~Name

What I would like is to have two version of the formula where I have
just the no. and name but without the "~" and a " " there instead. The
other version would be to have the same as above but with the letter
as well, ie
"A1234567890 Name"

What I have so far:

=REPT("",LEN(LEFT(A3,FIND("~",A3)-1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)-1))))&MID(A3,FIND("~",A3)+1,500) - Name
only but no number

=TRIM(LEN(LEFT(A3,FIND("~",A3)+1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)+1)))&SUBSTITUTE(A3," ~"," ")) = 20

I'm still getting to grips with this, so if someone could point me in
the right direction, I'd be grateful!

Cheers!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Formatting problem

G'day Stav

Don Guillett provided this aswer in another thread, it may help you.

Sub replaceem()
lr=cells(rows.count,"F").end(xlup).row
myarray = Array("-", "(", ")")
For Each i In myarray
Range("f4:f" & lr).Replace i, "", LookAt:=xlPart
Next i
End Sub

Try changing it to something like:

Sub Convert_To_Space()
lr=cells(rows.count,"A").end(xlup).row
myarray = Array("~")
For Each i In myarray
Range("A3:A" & lr).Replace i, "", LookAt:=xlPart
Next i
End Sub

HTH
Mark.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Formatting problem

If you are willing to use worksheet formula solutions...

Number-Space-Name
========================
=REPLACE(SUBSTITUTE(TRIM(A1),"~"," "),1,1,"")

Letter-Number-Space-Name
=========================
=SUBSTITUTE(TRIM(A1),"~"," ")

Change A1 to the actual cell containing your first piece of data and then
copy the formula down.

--
Rick (MVP - Excel)


"Stav19" wrote in message
...
Hi All

I've got about 1000 rows or so of entries which have the following
format in each cell:

(20 spaces at least)A1234567890~Name

What I would like is to have two version of the formula where I have
just the no. and name but without the "~" and a " " there instead. The
other version would be to have the same as above but with the letter
as well, ie
"A1234567890 Name"

What I have so far:

=REPT("",LEN(LEFT(A3,FIND("~",A3)-1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)-1))))&MID(A3,FIND("~",A3)+1,500) - Name
only but no number

=TRIM(LEN(LEFT(A3,FIND("~",A3)+1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)+1)))&SUBSTITUTE(A3," ~"," ")) = 20 No.
and name

I'm still getting to grips with this, so if someone could point me in
the right direction, I'd be grateful!

Cheers!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Formatting problem

On Sep 27, 3:57*pm, "Rick Rothstein"
wrote:
If you are willing to use worksheet formula solutions...

Number-Space-Name
========================
=REPLACE(SUBSTITUTE(TRIM(A1),"~"," "),1,1,"")

Letter-Number-Space-Name
=========================
=SUBSTITUTE(TRIM(A1),"~"," ")

Change A1 to the actual cell containing your first piece of data and then
copy the formula down.

--
Rick (MVP - Excel)

"Stav19" wrote in message

...



Hi All


I've got about 1000 rows or so of entries which have the following
format in each cell:


(20 spaces at least)A1234567890~Name


What I would like is to have two version of the formula where I have
just the no. and name but without the "~" and a " " there instead. The
other version would be to have the same as above but with the letter
as well, ie
"A1234567890 Name"


What I have so far:


=REPT("",LEN(LEFT(A3,FIND("~",A3)-1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)-1))))&MID(A3,FIND("~",A3)+1,500) - Name
only but no number


=TRIM(LEN(LEFT(A3,FIND("~",A3)+1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)+1)))&SUBSTITUTE(A3," ~"," ")) = 20 No.
and name


I'm still getting to grips with this, so if someone could point me in
the right direction, I'd be grateful!


Cheers!- Hide quoted text -


- Show quoted text -


Hi mark

thanks for getting back to me! That's pretty much what i'd be after
for VBA, but want to try and "keep it simple" although I'm pretty sure
I'm not!!!

Pete


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Formatting problem

On Sep 27, 3:57*pm, "Rick Rothstein"
wrote:
If you are willing to use worksheet formula solutions...

Number-Space-Name
========================
=REPLACE(SUBSTITUTE(TRIM(A1),"~"," "),1,1,"")

Letter-Number-Space-Name
=========================
=SUBSTITUTE(TRIM(A1),"~"," ")

Change A1 to the actual cell containing your first piece of data and then
copy the formula down.

--
Rick (MVP - Excel)

"Stav19" wrote in message

...



Hi All


I've got about 1000 rows or so of entries which have the following
format in each cell:


(20 spaces at least)A1234567890~Name


What I would like is to have two version of the formula where I have
just the no. and name but without the "~" and a " " there instead. The
other version would be to have the same as above but with the letter
as well, ie
"A1234567890 Name"


What I have so far:


=REPT("",LEN(LEFT(A3,FIND("~",A3)-1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)-1))))&MID(A3,FIND("~",A3)+1,500) - Name
only but no number


=TRIM(LEN(LEFT(A3,FIND("~",A3)+1))-
LEN(TRIM(LEFT(A3,FIND("~",A3)+1)))&SUBSTITUTE(A3," ~"," ")) = 20 No.
and name


I'm still getting to grips with this, so if someone could point me in
the right direction, I'd be grateful!


Cheers!- Hide quoted text -


- Show quoted text -


Hi Rick

Both of those work great, and are simpler than mine! Thanks for your
help

Pete
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
Formatting Problem John Calder New Users to Excel 2 April 6th 09 01:01 PM
formatting problem ayoubtt Excel Discussion (Misc queries) 0 March 18th 08 07:25 PM
Formatting problem? TwoDot Excel Discussion (Misc queries) 1 November 1st 07 01:27 PM
Formatting problem PE&T Setting up and Configuration of Excel 1 February 22nd 06 10:20 AM
formatting problem Orion[_2_] Excel Programming 2 October 14th 04 11:26 AM


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

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

About Us

"It's about Microsoft Excel"