Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 238
Default crop away the letters

For the following, I need to crop away the letters with a macro, excel
97
VWXY1234567Z
CropIt = Right(Liscence, 8)
1234567Z

How do I crop away the "Z" leaving only
1234567
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,104
Default crop away the letters

Without using VBA: =--LEFT(RIGHT(A1,8),7)
The double negation is used to convert the resulting text to a number

And this UDF does the same
Function CropIt(mycell)
CropIt = --Left(Right(mycell.Value, 8), 7)
End Function

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Fan924" wrote in message
...
For the following, I need to crop away the letters with a macro, excel
97
VWXY1234567Z
CropIt = Right(Liscence, 8)
1234567Z

How do I crop away the "Z" leaving only
1234567



  #3   Report Post  
Posted to microsoft.public.excel.misc
JCS JCS is offline
external usenet poster
 
Posts: 93
Default crop away the letters

Hi,

Try =MID(A1,5,7). If this helps please press Yes.

John

"Fan924" wrote:

For the following, I need to crop away the letters with a macro, excel
97
VWXY1234567Z
CropIt = Right(Liscence, 8)
1234567Z

How do I crop away the "Z" leaving only
1234567

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default crop away the letters

Sub dural()
Liscence = "VWXY1234567Z"
CropIt = Left(Right(Liscence, 8), 7)
MsgBox (CropIt)
End Sub

--
Gary''s Student - gsnu2007L


"Fan924" wrote:

For the following, I need to crop away the letters with a macro, excel
97
VWXY1234567Z
CropIt = Right(Liscence, 8)
1234567Z

How do I crop away the "Z" leaving only
1234567

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 238
Default crop away the letters

CropIt = Left(Right(Liscence, 8), 7)

Thanks, I was close by couldn't get the syntax right.
;<]
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
crop AutoCAD object jerryk571 Excel Discussion (Misc queries) 0 January 21st 09 06:33 PM
crop spreadsheet bekwud New Users to Excel 11 September 17th 06 10:35 PM
Is there a way to crop text in an Excel cell? cochranrg Excel Discussion (Misc queries) 6 December 13th 05 03:02 PM
Any function for Crop/Cut Text 0-0 Wai Wai ^-^ Excel Worksheet Functions 1 September 8th 05 01:29 PM
I want to truncate/crop 3854502.2 into 545 in Excel. How do I do. billybob Excel Worksheet Functions 2 November 19th 04 03:53 AM


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