Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ending "html" or change

Hi Expert,

I have to check if webadresses (of different sizes) in column A end on
"html" (e.g. www.variablestrings/buy/hold/details.html)
Sometimes, the end is more like html -25, or html 9 or html r7, or
whatever.
I would like to clean up all cell content after html
But how? Tried some already, but still in the mist...

best regards Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default ending "html" or change

It isn't clear what you are asking for, but the following might get
you going in the right direction.

Using Formulas: Test in A1 ends in "html"
=RIGHT(A1,4)="html"
return TRUE or FALSE

Remove text in A1 after "html"
=IF(RIGHT(A1,4)="html",A1,LEFT(A1,FIND("html",A1)+ 3))

Using VBA:

Dim S As String
Dim T As String
Dim N As Long
S = Range("a1").Value
N = InStr(1, S, "html", vbTextCompare)
If N Then
T = Left(S, N + 3)
Else
T = S
End If
Debug.Print T

S gets the value of cell A1. N = 0 means "html" not at end of S. N <
0 means "html" at end of S. T gets text in A1 before the "html"
string.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Thu, 10 Dec 2009 13:59:34 -0800 (PST), ppeer
wrote:

Hi Expert,

I have to check if webadresses (of different sizes) in column A end on
"html" (e.g. www.variablestrings/buy/hold/details.html)
Sometimes, the end is more like html -25, or html 9 or html r7, or
whatever.
I would like to clean up all cell content after html
But how? Tried some already, but still in the mist...

best regards Peter

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
Excel - How do I keep an ending space in a cell? i.e. "Mr. " jme123 Excel Discussion (Misc queries) 1 April 7th 09 03:02 AM
How do I keep a 17 digit number from ending in "0" in excel? creel28270 Excel Discussion (Misc queries) 6 June 18th 08 04:12 PM
How do I change the column heading in Excel to display "A" "B" "C Thai New Users to Excel 1 November 30th 07 08:06 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
=IF(D13="PAID","YES","NO") Can I change fonts colour Kev Excel Discussion (Misc queries) 3 February 17th 06 04:27 AM


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