Solved

syntax for replace

Posted on 2006-10-19
3
387 Views
Last Modified: 2008-03-04
can any one send me the piece of quote for the syntax
for replace one variable value entered into VB,its value should be stored

ie "Replace" method should be used i guess

i need the syntax

thanks
0
Comment
Question by:Prakashv20
  • 2
3 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
Replace(expression, find, replacewith[, start[, count[, compare]]])

Check this out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/65e15b2c-99b6-4f82-88e7-8c657489dd34.asp
0
 
LVL 11

Accepted Solution

by:
ch2 earned 250 total points
Comment Utility
Private Sub Form_Load()

    Dim Original As String
    Dim Search As String
    Dim Add As String
    Dim Replaced As String
   
    Original = "My dog eats apples"
    Search = "apples"
    Add = "mushrooms"
   
    Replaced = Original & Chr(13) & Replace(Original, Search, Add, 1, -1, vbTextCompare)
   
    MsgBox (Replaced)

End Sub
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now