Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting the number in the first line of the address in a cell

I have spent the last few hours trying to find out haw to delete
numbers in the first line of the address in excel, by using a macro or
formula.

For example

In a particular cell I would have

35 Mill View Road and I want to strip the numbers just to leave Mill
View Road.

I'm a Novice when programming in Excel.

Hope somebody can help me, Thanks in advance

Regards

Andy P
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Deleting the number in the first line of the address in a cell

Untested:

I = instr(activecell.value," ")
if I 0 then
activecell.value = mid(activecell.value, I+1)
End if

Instr returns the starting location of a string, in this case a space.
Mid, returns the text starting at the I+1 character postion.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"andy peo" wrote in message
...
I have spent the last few hours trying to find out haw to delete
numbers in the first line of the address in excel, by using a macro or
formula.

For example

In a particular cell I would have

35 Mill View Road and I want to strip the numbers just to leave Mill
View Road.

I'm a Novice when programming in Excel.

Hope somebody can help me, Thanks in advance

Regards

Andy P



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting the number in the first line of the address in a cell

do the numbers always go at the beginning of the address, such as:

35 melrose place
and you need melrose place


or

you may have


1) C/ san jeronimo 11, 5B (28010) madrid
2) 28 oxford Strees, 54W-47

and you need

C/ san jeronimo , B () madrid
oxford Strees, W-


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Deleting the number in the first line of the address in a cell

I like the second one. ;-)

Function NoNums(s As String) As String
Dim i As Integer
Dim buf As String
Dim char As String
For i = 1 To Len(s)
char = Mid(s, i, 1)
If Not IsNumeric(char) Then
buf = buf & char
End If
Next i
NoNums = buf
End Function

Function NoNums2(s As String) As String
NoNums2 = _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
s, 1, "") _
, 2, "") _
, 3, "") _
, 4, "") _
, 5, "") _
, 6, "") _
, 7, "") _
, 8, "") _
, 9, "") _
, 0, "")
End Function



"andy peo" wrote in message
...
I have spent the last few hours trying to find out haw to delete
numbers in the first line of the address in excel, by using a macro or
formula.

For example

In a particular cell I would have

35 Mill View Road and I want to strip the numbers just to leave Mill
View Road.

I'm a Novice when programming in Excel.

Hope somebody can help me, Thanks in advance

Regards

Andy P



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting the number in the first line of the address in a cell

I feel a bit stupid asking this question but i have tried.

How would you get this function NoNums in to excel and to run it in the worksheet

Thanks in advance

Regards

Andy P


"Bob Kilmer" wrote in message ...
I like the second one. ;-)

Function NoNums(s As String) As String
Dim i As Integer
Dim buf As String
Dim char As String
For i = 1 To Len(s)
char = Mid(s, i, 1)
If Not IsNumeric(char) Then
buf = buf & char
End If
Next i
NoNums = buf
End Function

Function NoNums2(s As String) As String
NoNums2 = _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
s, 1, "") _
, 2, "") _
, 3, "") _
, 4, "") _
, 5, "") _
, 6, "") _
, 7, "") _
, 8, "") _
, 9, "") _
, 0, "")
End Function



"andy peo" wrote in message
...
I have spent the last few hours trying to find out haw to delete
numbers in the first line of the address in excel, by using a macro or
formula.

For example

In a particular cell I would have

35 Mill View Road and I want to strip the numbers just to leave Mill
View Road.

I'm a Novice when programming in Excel.

Hope somebody can help me, Thanks in advance

Regards

Andy P



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Deleting the number in the first line of the address in a cell

David McRitchie has an intro to macros at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel.
Into a test cell and type:
=nonums(a1)

===
And a word of warning--if you're using xl97, change "replace" to
"application.substitute" (all of them).

(Replace was added in xl2k.)

andy peo wrote:

I feel a bit stupid asking this question but i have tried.

How would you get this function NoNums in to excel and to run it in the worksheet

Thanks in advance

Regards

Andy P

"Bob Kilmer" wrote in message ...
I like the second one. ;-)

Function NoNums(s As String) As String
Dim i As Integer
Dim buf As String
Dim char As String
For i = 1 To Len(s)
char = Mid(s, i, 1)
If Not IsNumeric(char) Then
buf = buf & char
End If
Next i
NoNums = buf
End Function

Function NoNums2(s As String) As String
NoNums2 = _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
Replace( _
s, 1, "") _
, 2, "") _
, 3, "") _
, 4, "") _
, 5, "") _
, 6, "") _
, 7, "") _
, 8, "") _
, 9, "") _
, 0, "")
End Function



"andy peo" wrote in message
...
I have spent the last few hours trying to find out haw to delete
numbers in the first line of the address in excel, by using a macro or
formula.

For example

In a particular cell I would have

35 Mill View Road and I want to strip the numbers just to leave Mill
View Road.

I'm a Novice when programming in Excel.

Hope somebody can help me, Thanks in advance

Regards

Andy P


--

Dave Peterson

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
deleting the first 2 digits of number in a cell NoviceMALGER Excel Worksheet Functions 2 January 8th 09 07:05 PM
Insertion of a cell address that constantly rises by a set number stew Excel Discussion (Misc queries) 13 August 24th 08 06:50 PM
Find max number of character and return cell address ExcelMonkey Excel Worksheet Functions 5 April 15th 06 04:13 AM
How do I include cell data in subject line of email address/hyperl gvinnola Excel Worksheet Functions 1 November 18th 04 02:36 AM
Number format as condition for not deleting a line mjwillyone[_8_] Excel Programming 6 December 30th 03 10:25 PM


All times are GMT +1. The time now is 06:07 PM.

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"