Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

eliminating first character

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
continuing on my work with strings, i know how to select only a string until a certain character

ActiveCell.Value = Left(ActiveCell.Text, InStr(ActiveCell.Text, " ") - 1)

in this case a blank

but now how would i be able to still do that, but not start from all the way on the left, i want to skip the first character and then start from the 2nd character (or perhaps 3rd etc.) and then go until the blank, thanks!
 
Search VBA Help for Mid .. there are several functions and statements listed with good examples.
Here is one ...
Mid Function Example
The first example uses the Mid function to return a specified number of characters from a string.

Dim MyString, FirstWord, LastWord, MidWords
MyString = "Mid Function Demo" ' Create text string.
FirstWord = Mid(MyString, 1, 3) ' Returns "Mid".
LastWord = Mid(MyString, 14, 4) ' Returns "Demo".
MidWords = Mid(MyString, 5) ' Returns "Function Demo".

HTH
Michael
 
Check Instr Help. You'll see that Instr() can have four arguments, If the first one is numeric it will do what you want.

Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top