Solved

syntax for replace

Posted on 2006-10-19
3
390 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 51

Expert Comment

by:Ryan Chong
ID: 17770995
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
ID: 17771002
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 51

Expert Comment

by:Ryan Chong
ID: 17771007
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

827 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