Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Find All Numbers and Text in a cell

I have a column of Text and numbers that are combined. Sometimes the
column is just numbers and other times it is Numbers and text. For
instance LDDC68, LDDC69..... M45, 46......458, 459. I want to add
the next number in the list. I think I can use isnumber for the ones
that are numbers but not letters. I am doing this through VBA. any
help will be appreciated.

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Find All Numbers and Text in a cell

Hi,

I can understand about a column of cells that contain text and numbers mixed
but having extracted the numbers what do you want to do with them, I don't
understand


I want to add the next number in the list

Please clarify

Mike
"jlclyde" wrote:

I have a column of Text and numbers that are combined. Sometimes the
column is just numbers and other times it is Numbers and text. For
instance LDDC68, LDDC69..... M45, 46......458, 459. I want to add
the next number in the list. I think I can use isnumber for the ones
that are numbers but not letters. I am doing this through VBA. any
help will be appreciated.

Thanks,
Jay

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Find All Numbers and Text in a cell

LDDC68, LDDC69..... *M45, M46......458, 459. * I want to add
the next number in the list. *


The next number in the list referes to the next consecutive number
that would happen after the given values. If the value was LDDC69
then the next number would be LDDC70. If the value was M46 the next
number would be M47. If the value were 100 the next value woudl be
101.

Thanks,
Jay

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Find All Numbers and Text in a cell

Here is how I did it with a function. Then I can call this function
any time I want.

Function RemoveText(Cel) As Variant
Dim intIndex As Integer
Dim Str As String

intIndex = 1
Str = ""
Do While intIndex <= Len(Cel) 'Do until all characters have been
checked
Select Case UCase(Mid(Cel, intIndex, 1)) 'How it checks each
character
Case "A" To "Z" 'Checks all non numeric characters'
If intIndex 1 Then
Str = Str & Mid(Cel, intIndex, 1)
Cel = Left(Cel, intIndex - 1) & Mid(Cel, intIndex + 1)
Else
Str = Str & Mid(Cel, intIndex, 1)
Cel = Mid(Cel, intIndex + 1)

End If
Case Else
intIndex = intIndex + 1
End Select
Loop
RemoveText = Str & Cel + 1
End Function
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
how to extract numbers from imported cell with text and numbers? jyin Excel Discussion (Misc queries) 3 March 28th 07 01:14 PM
Find $ in a string of text and return numbers Craig Excel Discussion (Misc queries) 5 September 13th 06 10:42 PM
find text in column h and total the corresponding numbers if colum adelaide Excel Discussion (Misc queries) 2 February 6th 06 04:47 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM


All times are GMT +1. The time now is 08:09 PM.

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"