STRING MANIPULATION !!

J

jay dean

Hello !

AA is a variable that contains a string. BB is another string variable.

I need a macro that will create a new string CC which is made by
inserting BB into AA (after the first word in AA).

Example: If AA="They are capable" and BB="think they", then CC should be
"They think they are capable." Any help would be apreciated!

Thanks
Jay



*** Sent via Developersdex http://www.developersdex.com ***
 
M

mudraker

Heres 1 way


Code:
--------------------

Sub ManipulateText()
Dim AA As String
Dim BB As String
Dim CC As String
Dim iPos As Integer


AA = "They are capable"
BB = "think they"

iPos = InStr(1, AA, " ")
CC = Left(AA, iPos) & BB & Mid(AA, iPos)
MsgBox CC
End Sub

--------------------


--
mudraker

If my reply has assisted or failed to assist you I welcome your
Feedback.

www.thecodecage.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top