LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Delete characters up to ":"

You can use InStr() to search for the colon and Mid() to ignore the stuff before
it.

Option Explicit
Sub testme()

Dim myStr As String
Dim colonPos As Long

myStr = "this is a test: for removing colons"

colonPos = InStr(1, myStr, ":")
If colonPos 0 Then
myStr = Mid(myStr, colonPos + 1) '+2 to get rid of the linefeed?
End If

MsgBox myStr

End Sub

Robbyn wrote:

I have created a report page that copies comment.txt from the source page (thanks again for help Tom). I'm wondering if it's possible to delete all characters up to and including the ":" on the report page. (This will get rid of the username info).

Robbyn

(Make it stop raining please, ty)


--

Dave Peterson

 
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
is there a way to delete all characters to the right of a ":"? [email protected] Excel Discussion (Misc queries) 4 May 11th 23 11:47 AM
If specific # of certain characters in a range, "OK", if not "Aler Steve Excel Worksheet Functions 4 June 10th 09 07:05 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM


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