ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text string to a number (https://www.excelbanter.com/excel-programming/391544-text-string-number.html)

AshMorK

Text string to a number
 
The following function returns a text..but i want to get it as a number:

Public Function Gmid(vin)
If Mid(vin, 12, 1) < "A" And Mid(vin, 12, 1) 0 Then
ID = Right(vin, 6)
Else
ID = Right(vin, 5)
End If
Gmid = ID
End Function

Thanks in advance x your help!

AhsMorK (chile)

Vasant Nanavati

Text string to a number
 
Public Function Gmid(vin) As Long
__________________________________________________ _____________________

"AshMorK" wrote in message
...
The following function returns a text..but i want to get it as a number:

Public Function Gmid(vin)
If Mid(vin, 12, 1) < "A" And Mid(vin, 12, 1) 0 Then
ID = Right(vin, 6)
Else
ID = Right(vin, 5)
End If
Gmid = ID
End Function

Thanks in advance x your help!

AhsMorK (chile)





All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com