You could also use
=MID(A1, FIND("/", A1)+1, LEN(A1))
instead of
=RIGHT(A1,LEN(A1)-FIND("/"
slashIndex = Application.WorksheetFunction.Find("/", Range("A1"))
slashIndex = InStr(Range("A1").Value, "/")
Function LeftOfSlash(rng As Range) As String
Dim slashIndex As Integer
slashIndex = InStr(rng.Value, "/")
LeftOfSlash = Left(rng.Value, slashIndex - 1)
End Function
Function RightOfSlash(rng As Range) As String
Dim slashIndex As Integer
slashIndex = InStr(rng.Value, "/")
RightOfSlash = Right(rng.Value, Len(rng.Value) - slashIndex)
End Function
Sub LeftOfSlashSub()
Range("D1").Value = Left(Range("A1").Value, InStr(Range("A1").Value, "/") - 1)
End Sub
Sub RightOfSlashSub()
Range("E1").Value = Right(Range("A1").Value, Len(Range("A1").Value) - InStr(Range("A1").Value, "/"))
End Sub
Sub LeftOfSlashSub()
Dim InputStr as String
Dim slashIndex as Integer
Set InputStr = Range("A1").Value
slashIndex = InStr(InputStr , "/")
Range("D1").Value = Left(InputStr , slashIndex - 1)
End Sub
Title | # Comments | Views | Activity |
---|---|---|---|
Any conditional formatting for currency formats in Excel 2010? | 13 | 19 | |
Excel 2010: Convert workbook to PDF - how can you enable intra-workbook hyperlinks ? | 32 | 149 | |
Excel 2010 Slicer Issue | 3 | 35 | |
Excel Formula return each instance from list | 2 | 55 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
6 Experts available now in Live!