Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default How do I find last occurence of a character in a text string in Ex

as well as the two responses already received, you could also use the SPLIT
function

This is particularly useful if you want to see how many items are in the text

eg
Option Explicit
Sub SplitDemo()
Dim text As String
Dim var As Variant
text = "There are four words"
var = Split(text, " ")

MsgBox "text has " & UBound(var, 1) + 1 & " items"

Dim index As Long
index = UBound(var, 1)
MsgBox "The #" & index & " item =" & var(index)

End Sub


"jten" wrote:

I am looking for the last occurrence of a blank in a text string so that I
can parse the string

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
Find Multiple Occurence Of Text In A Column Steve[_91_] Excel Programming 7 September 7th 07 01:54 PM
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
How to find the first occurence of any number in a string Caio Milani Excel Programming 2 November 7th 06 08:02 PM
Find last occurance of character in text string JDay01 Excel Worksheet Functions 2 February 14th 06 04:29 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


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