Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok Dave, playing around with it to see what I get. Thanks for the help. :)
Robbyn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay Dave. Can't sleep so played around with your code, and it most definitely works when I use activeCell. But the following code doesn't
Sub textme( Dim myStr As Strin Dim colonPos As Lon Dim cell As Rang For Each cell In Range("a1:a15" myStr = cell.Valu colonPos = InStr(1, myStr, ":" If colonPos 0 The myStr = Mid(myStr, colonPos + 1 End I Next cel End Su Any idea why? (thanks again Robbyn |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please disregard post. Figured out my problem. :
Robbyn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
is there a way to delete all characters to the right of a ":"? | Excel Discussion (Misc queries) | |||
If specific # of certain characters in a range, "OK", if not "Aler | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions |