Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 9
Default String Parse

Greetings All

Could someone help me figure out a working model to trim a
file being offered as a string in a URL?

Example: strFileUrl = http://www.web.com/doc.doc so that
something like strTrimmedURL (variable) would be available?
The goal would be for strTrimmedURL to = doc.doc
Please advise.

J
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default String Parse

J,

Use the InStrRev function to find the last '/' character, then
use Mid to get the remaining portion of the string. E.g.,

Dim strFileUrl As String
Dim TrimmedURL As String
Dim Pos As Integer
strFileUrl = "http://www.web.com/doc.doc"
Pos = InStrRev(strFileUrl, "/")
TrimmedURL = Mid(strFileUrl, Pos + 1)
Debug.Print TrimmedURL


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"J" wrote in message
...
Greetings All

Could someone help me figure out a working model to trim a
file being offered as a string in a URL?

Example: strFileUrl = http://www.web.com/doc.doc so that
something like strTrimmedURL (variable) would be available?
The goal would be for strTrimmedURL to = doc.doc
Please advise.

J



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default String Parse

On Tue, 10 Aug 2004 14:04:43 -0700, "J"
wrote:

Greetings All

Could someone help me figure out a working model to trim a
file being offered as a string in a URL?

Example: strFileUrl = http://www.web.com/doc.doc so that
something like strTrimmedURL (variable) would be available?
The goal would be for strTrimmedURL to = doc.doc
Please advise.

J


Perhaps this will give you an idea. Requires later version of Excel with VBA6

=====================
Sub foo()
Const strFileUrl As String = "http://www.web.com/doc.doc"
Dim Temp
Dim strTrimmedURL

Temp = Split(strFileUrl, "/")
strTrimmedURL = Temp(UBound(Temp))

MsgBox (strTrimmedURL)

End Sub
========================


--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 9
Default String Parse

Chip

you rock

J
-----Original Message-----
J,

Use the InStrRev function to find the last '/' character,

then
use Mid to get the remaining portion of the string. E.g.,

Dim strFileUrl As String
Dim TrimmedURL As String
Dim Pos As Integer
strFileUrl = "http://www.web.com/doc.doc"
Pos = InStrRev(strFileUrl, "/")
TrimmedURL = Mid(strFileUrl, Pos + 1)
Debug.Print TrimmedURL


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"J" wrote in message
...
Greetings All

Could someone help me figure out a working model to

trim a
file being offered as a string in a URL?

Example: strFileUrl = http://www.web.com/doc.doc so that
something like strTrimmedURL (variable) would be

available?
The goal would be for strTrimmedURL to = doc.doc
Please advise.

J



.

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
Parse A String into Two xlmate Excel Worksheet Functions 11 February 21st 09 04:06 AM
parse text string Dave F[_2_] Excel Worksheet Functions 4 April 29th 07 07:48 AM
Parse this string David Excel Discussion (Misc queries) 2 February 20th 07 04:57 AM
How to parse a string with a date? [email protected] Excel Worksheet Functions 1 June 13th 06 07:46 AM
Q: parse string JIM.H. Excel Discussion (Misc queries) 3 October 22nd 05 01:45 AM


All times are GMT +1. The time now is 02:52 AM.

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"