Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Use of the MID function


I have a lot of these strings in each cell:

CHEQUE DEPOSITADO NESTA I.CREDITO N. 4378319839

The are not always equal, the number of charecters can change a lot.
How do i use the MID function to allways extract to another column the
8 last figures less the two last ones.
In this case, the number be extracted should be 783198. Please note
that, as i said, the strings size can vary, but the figures allways
come in the end.

Thanks a lot


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile: http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=564310

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default Use of the MID function

Hi Teixiera,

De acordo com o texto da sua mensagem você deve enteder Português,
copie e cole o módulo abaixo (ALT+F11).

use a função =digitsonly(a2) na coluna ao lado, você somente terá os números
lá.

use a função MID

espero ter ajudado
um abraço do Brazil
Marcelo


**********************************************
Public Function DigitsOnly(sStr As String) As Variant
Dim oRegExp As Object

Set oRegExp = CreateObject("VBScript.RegExp")

With oRegExp
.IgnoreCase = True
.Global = True
oRegExp.Pattern = "\D"

DigitsOnly = oRegExp.Replace(sStr, vbNullString)
End With
End Function
**************************************************



"oteixeira" escreveu:


I have a lot of these strings in each cell:

CHEQUE DEPOSITADO NESTA I.CREDITO N. 4378319839

The are not always equal, the number of charecters can change a lot.
How do i use the MID function to allways extract to another column the
8 last figures less the two last ones.
In this case, the number be extracted should be 783198. Please note
that, as i said, the strings size can vary, but the figures allways
come in the end.

Thanks a lot


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile: http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=564310


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 430
Default Use of the MID function

=MID(A1,LEN(A1)-7,6)

See if this does the trick for you.

"oteixeira" wrote:


I have a lot of these strings in each cell:

CHEQUE DEPOSITADO NESTA I.CREDITO N. 4378319839

The are not always equal, the number of charecters can change a lot.
How do i use the MID function to allways extract to another column the
8 last figures less the two last ones.
In this case, the number be extracted should be 783198. Please note
that, as i said, the strings size can vary, but the figures allways
come in the end.

Thanks a lot


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile: http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=564310


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Use of the MID function


Obigado Marcelo. Está perfeito. Tentei com MID , RIGHT, etc. Mas nada
deu...


--
oteixeira
------------------------------------------------------------------------
oteixeira's Profile: http://www.excelforum.com/member.php...o&userid=35320
View this thread: http://www.excelforum.com/showthread...hreadid=564310

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
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 11:15 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Hyperlinks using R[1]C[1] and offset function in its cell referenc Elijah-Dadda Excel Worksheet Functions 0 March 5th 05 04:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 03:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 11:49 AM


All times are GMT +1. The time now is 10:22 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"