Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Replace function - Excel

Posted on 2011-09-12
6
Medium Priority
?
172 Views
Last Modified: 2012-05-12
How can I replace, in a column, a caracter by an other one.

example:

With Worksheets("Question").Range("A:A").Selection
    .Replace What:="Your Name?", Replacement:="Question1", LookAt:=xlPart, MatchCase:=False
End With
0
Comment
Question by:Karl001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 36522371
Let us assume that in A1 cell we have Welcome. then this formula

=REPLACE(A1,FIND("o",A1,1),3,"t") will replace o with t.

The result will be as Welctme
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 36522378
sorry this should be
=REPLACE(A1,FIND("o",A1,1),3,"t") will replace o with t.
 as
=REPLACE(A1,FIND("o",A1,1),1,"t") will replace o with t.
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 36522389
The best way i would recommend is to go for a macro
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 36522423
Public Sub replacechar()
Dim findstring As String
Dim replacestring As String
findstring = "e"
replacestring = "t"
    For i = 1 To 100 ' cells from first row to 100 in the column A (A1 to A100)
    If Cells(i, 1) <> "" Then
    Do Until InStr(1, Cells(i, 1), findstring, vbTextCompare) = 0
        Cells(i, 1) = Replace(LCase(Cells(i, 1)), LCase(findstring), LCase(replacestring), 1, 1, vbTextCompare)
    Loop
    End If
    Next i
End Sub
0
 

Accepted Solution

by:
Karl001 earned 0 total points
ID: 36522497
found solution by usion macro record:

Columns("A:A").Select
Selection.Replace What:="YourName?", _
                               Replacement:=",Question,", LookAt:=xlPart , _
                               SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
                               ReplaceFormat:=False
0
 

Author Closing Comment

by:Karl001
ID: 36553424
find solution
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

610 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